1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-07-29 21:41:20 +03:00

Export POSTGRES_USER and POSTGRES_DB vars in entrypoint

Allows them to be used from /docker-entrypoint-initdb.d/*.sh scripts
This commit is contained in:
Mike Dillon
2015-08-25 20:30:57 -07:00
parent 118e25a737
commit cd294bf8df
7 changed files with 7 additions and 0 deletions

View File

@ -52,6 +52,7 @@ if [ "$1" = 'postgres' ]; then
: ${POSTGRES_USER:=postgres}
: ${POSTGRES_DB:=$POSTGRES_USER}
export POSTGRES_USER POSTGRES_DB
if [ "$POSTGRES_DB" != 'postgres' ]; then
psql --username postgres <<-EOSQL