From cd294bf8dfdf4a74b2077aa6413fa579f9bf07de Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Tue, 25 Aug 2015 20:30:57 -0700 Subject: [PATCH] Export POSTGRES_USER and POSTGRES_DB vars in entrypoint Allows them to be used from /docker-entrypoint-initdb.d/*.sh scripts --- 9.0/docker-entrypoint.sh | 1 + 9.1/docker-entrypoint.sh | 1 + 9.2/docker-entrypoint.sh | 1 + 9.3/docker-entrypoint.sh | 1 + 9.4/docker-entrypoint.sh | 1 + 9.5/docker-entrypoint.sh | 1 + docker-entrypoint.sh | 1 + 7 files changed, 7 insertions(+) diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index a8d6252557..87d7e3b87c 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -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 diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index a8d6252557..87d7e3b87c 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -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 diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index a8d6252557..87d7e3b87c 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -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 diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index a8d6252557..87d7e3b87c 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -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 diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index a8d6252557..87d7e3b87c 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -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 diff --git a/9.5/docker-entrypoint.sh b/9.5/docker-entrypoint.sh index a8d6252557..87d7e3b87c 100755 --- a/9.5/docker-entrypoint.sh +++ b/9.5/docker-entrypoint.sh @@ -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 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a8d6252557..87d7e3b87c 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -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