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

Adjust "docker_temp_server_start" to override port for consistent unix socket path

This commit is contained in:
Tianon Gravi
2019-11-25 17:15:02 -08:00
parent 5beb1d4c3a
commit 820323fa89
13 changed files with 65 additions and 26 deletions

View File

@ -212,11 +212,14 @@ docker_temp_server_start() {
if [ "$1" = 'postgres' ]; then
shift
fi
# internal start of server in order to allow setup using psql client
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
# does not listen on external TCP/IP and waits until start finishes
set -- "$@" -c listen_addresses='' -p 5432
PGUSER="${PGUSER:-$POSTGRES_USER}" \
pg_ctl -D "$PGDATA" \
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
-o "$(printf '%q ' "$@")" \
-w start
}