The column at the beginning of the line at the entry point of the docker bash script

I looked at the script entry point for the docker image , and they had the following lines (53-54)

: ${POSTGRES_USER:=postgres}
: ${POSTGRES_DB:=$POSTGRES_USER}

I saw this topic. What is the purpose: (colon) GNU Bash builtin?

and was able to determine :what true meant, and what was :=used to assign default values, but in fact it does not affect the fact that :at the beginning of the line, at least for this particular case.

+4
source share
1 answer

Bourne , Bash, : - no-op: , . (#), (, #, ).

:

: ${POSTGRES_USER:=postgres}

. ${POSTGRES_USER:=postgres} (a) POSTGRES_USER postgres , (b) $POSTGRES_USER, :

# ${POSTGRES_USER:=postgres}

... , . : , ${...} , POSTGRES_USER .

:, :

${POSTGRES_USER:=postgres}

! - postgres, script, :

postgres

, , :

bash: postgres: command not found...
+14

All Articles