Skip to content

Commit 50ea342

Browse files
authored
Merge pull request docker-library#642 from infosiftr/temporary-port
Adjust "docker_temp_server_start" to override port for consistent unix socket path
2 parents 5beb1d4 + 820323f commit 50ea342

13 files changed

+65
-26
lines changed

10/alpine/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

10/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

11/alpine/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

11/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

12/alpine/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

12/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

9.4/alpine/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

9.4/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

9.5/alpine/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

9.5/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

9.6/alpine/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

9.6/docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

docker-entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,14 @@ docker_temp_server_start() {
212212
if [ "$1" = 'postgres' ]; then
213213
shift
214214
fi
215+
215216
# internal start of server in order to allow setup using psql client
216-
# does not listen on external TCP/IP and waits until start finishes (can be overridden via args)
217+
# does not listen on external TCP/IP and waits until start finishes
218+
set -- "$@" -c listen_addresses='' -p 5432
219+
217220
PGUSER="${PGUSER:-$POSTGRES_USER}" \
218221
pg_ctl -D "$PGDATA" \
219-
-o "-c listen_addresses='' $([ "$#" -gt 0 ] && printf '%q ' "$@")" \
222+
-o "$(printf '%q ' "$@")" \
220223
-w start
221224
}
222225

0 commit comments

Comments
 (0)