Skip to content

Commit 719e9b2

Browse files
committed
move CMD exec
1 parent 98c3498 commit 719e9b2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docker-entrypoint.sh

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export PGDATANEW=/pg_new/data
2121
export PGUSER="${PGUSER}"
2222

2323
if [ "$#" -eq 0 -o "${1:0:1}" = '-' ]; then
24-
set -- pg_upgrade "$@"
24+
set -- pg_upgrade
2525
fi
2626

2727
if [ "$(id -u)" = '0' ] ;then
@@ -65,9 +65,12 @@ eval "${PGBINOLD}/pg_ctl -D ${PGDATAOLD} -l logfile stop"
6565
[ -z "${LOCALE}" ] && LOCALE="en_US.utf8"
6666
eval "${PGBINNEW}/initdb --username=${PGUSER} --pgdata=${PGDATANEW} --encoding=${ENCODING} --lc-collate=${LOCALE} --lc-ctype=${LOCALE}"
6767

68+
# run pg_upgrade or launch CMD
6869
if [ "$1" = 'pg_upgrade' ] ;then
6970
# Upgrade DB PG_OLD into PG_NEW
7071
eval "/usr/lib/postgresql/${PG_NEW}/bin/pg_upgrade"
72+
else
73+
exec "$@"
7174
fi
7275

7376
## Update pg config listen_address
@@ -79,7 +82,3 @@ fi
7982
#host all all 172.17.0.0/16 trust
8083
#EOF
8184
#chown postgres:postgres ${PGDATANEW}/pg_hba.conf
82-
83-
if [ "$1" != 'pg_upgrade' ] ;then
84-
exec "$@"
85-
fi

0 commit comments

Comments
 (0)