From c444bceb4ffbeda91f8e406a8dc38891188ff6b6 Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Fri, 21 Aug 2015 22:57:17 -0700 Subject: [PATCH] Run /docker-entrypoint-initdb.d/*.sql scripts as $POSTGRES_USER --- 9.0/docker-entrypoint.sh | 2 +- 9.1/docker-entrypoint.sh | 2 +- 9.2/docker-entrypoint.sh | 2 +- 9.3/docker-entrypoint.sh | 2 +- 9.4/docker-entrypoint.sh | 2 +- 9.5/docker-entrypoint.sh | 2 +- docker-entrypoint.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 74912e7e50..a8d6252557 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -75,7 +75,7 @@ if [ "$1" = 'postgres' ]; then for f in /docker-entrypoint-initdb.d/*; do case "$f" in *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; psql --username postgres --dbname "$POSTGRES_DB" < "$f" && echo ;; + *.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *) echo "$0: ignoring $f" ;; esac echo diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 74912e7e50..a8d6252557 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -75,7 +75,7 @@ if [ "$1" = 'postgres' ]; then for f in /docker-entrypoint-initdb.d/*; do case "$f" in *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; psql --username postgres --dbname "$POSTGRES_DB" < "$f" && echo ;; + *.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *) echo "$0: ignoring $f" ;; esac echo diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 74912e7e50..a8d6252557 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -75,7 +75,7 @@ if [ "$1" = 'postgres' ]; then for f in /docker-entrypoint-initdb.d/*; do case "$f" in *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; psql --username postgres --dbname "$POSTGRES_DB" < "$f" && echo ;; + *.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *) echo "$0: ignoring $f" ;; esac echo diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 74912e7e50..a8d6252557 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -75,7 +75,7 @@ if [ "$1" = 'postgres' ]; then for f in /docker-entrypoint-initdb.d/*; do case "$f" in *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; psql --username postgres --dbname "$POSTGRES_DB" < "$f" && echo ;; + *.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *) echo "$0: ignoring $f" ;; esac echo diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 74912e7e50..a8d6252557 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -75,7 +75,7 @@ if [ "$1" = 'postgres' ]; then for f in /docker-entrypoint-initdb.d/*; do case "$f" in *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; psql --username postgres --dbname "$POSTGRES_DB" < "$f" && echo ;; + *.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *) echo "$0: ignoring $f" ;; esac echo diff --git a/9.5/docker-entrypoint.sh b/9.5/docker-entrypoint.sh index 74912e7e50..a8d6252557 100755 --- a/9.5/docker-entrypoint.sh +++ b/9.5/docker-entrypoint.sh @@ -75,7 +75,7 @@ if [ "$1" = 'postgres' ]; then for f in /docker-entrypoint-initdb.d/*; do case "$f" in *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; psql --username postgres --dbname "$POSTGRES_DB" < "$f" && echo ;; + *.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *) echo "$0: ignoring $f" ;; esac echo diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 74912e7e50..a8d6252557 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -75,7 +75,7 @@ if [ "$1" = 'postgres' ]; then for f in /docker-entrypoint-initdb.d/*; do case "$f" in *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; psql --username postgres --dbname "$POSTGRES_DB" < "$f" && echo ;; + *.sql) echo "$0: running $f"; psql --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" < "$f" && echo ;; *) echo "$0: ignoring $f" ;; esac echo