From 2248b6502e596b7d8b79f7200cb985c6bfe63ad9 Mon Sep 17 00:00:00 2001 From: youngkermit8-coder <263626606+youngkermit8-coder@users.noreply.github.com> Date: Mon, 19 Oct 2026 15:15:56 +0800 Subject: [PATCH] fix(entrypoint): honor PGPORT in initialization SQL --- 1/trixie/docker-entrypoint.sh | 2 +- 3/bookworm/docker-entrypoint.sh | 2 +- 3/trixie/docker-entrypoint.sh | 2 +- 3/ubi8/docker-entrypoint.sh | 2 +- 4/bookworm/docker-entrypoint.sh | 2 +- 4/trixie/docker-entrypoint.sh | 2 +- 4/ubi8/docker-entrypoint.sh | 2 +- 5/bookworm/docker-entrypoint.sh | 2 +- 5/trixie/docker-entrypoint.sh | 2 +- 5/ubi8/docker-entrypoint.sh | 2 +- docker-entrypoint.sh | 2 +- tests/entrypoint-port.sh | 40 +++++++++++++++++++++++++++++++++ 12 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 tests/entrypoint-port.sh diff --git a/1/trixie/docker-entrypoint.sh b/1/trixie/docker-entrypoint.sh index 87b4677..b1bdf23 100755 --- a/1/trixie/docker-entrypoint.sh +++ b/1/trixie/docker-entrypoint.sh @@ -196,7 +196,7 @@ docker_process_init_files() { # ie: docker_process_sql -f my-file.sql # ie: docker_process_sql &2 + return 1 + } + return + fi + shift + done + echo 'SQL client port missing' >&2 + return 1 + } + pg_ctl() { + while (( $# )); do + if [[ $1 == -o ]]; then + [[ " $2 " == *" -p $expected_port "* ]] + return + fi + shift + done + return 1 + } + docker_temp_server_start postgres + docker_process_sql --command 'SELECT 1' + ) + done +done +echo 'All entrypoint client/server port checks passed'