From ffed6459c73ad7d2f417138ebbe8c3209eec892f Mon Sep 17 00:00:00 2001 From: DQ Date: Fri, 16 Apr 2021 18:37:24 +0800 Subject: [PATCH] Fix: Use local host on db's healthcheck hostname -i will malfunction in some cases like the `nsswitch.conf` file does'nt exist Signed-off-by: DQ --- make/photon/db/docker-healthcheck.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/make/photon/db/docker-healthcheck.sh b/make/photon/db/docker-healthcheck.sh index e43ea4929..c80542754 100644 --- a/make/photon/db/docker-healthcheck.sh +++ b/make/photon/db/docker-healthcheck.sh @@ -1,8 +1,7 @@ #!/bin/bash set -eo pipefail -h="$(hostname -i || echo '127.0.0.1')" -host="${h%%[[:space:]]*}" #remove the trailing space +host="localhost" user="${POSTGRES_USER:-postgres}" db="${POSTGRES_DB:-$POSTGRES_USER}" export PGPASSWORD="${POSTGRES_PASSWORD:-}"