diff --git a/cmd/postgres_exporter/tests/docker-postgres-replication/Dockerfile.p2 b/cmd/postgres_exporter/tests/docker-postgres-replication/Dockerfile.p2 index e517a729..1689000d 100644 --- a/cmd/postgres_exporter/tests/docker-postgres-replication/Dockerfile.p2 +++ b/cmd/postgres_exporter/tests/docker-postgres-replication/Dockerfile.p2 @@ -2,6 +2,7 @@ FROM postgres:{{VERSION}} MAINTAINER Daniel Dent (https://www.danieldent.com) ENV PG_MAX_WAL_SENDERS 8 ENV PG_WAL_KEEP_SEGMENTS 8 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y inetutils-ping COPY setup-replication.sh /docker-entrypoint-initdb.d/ COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint-initdb.d/setup-replication.sh /docker-entrypoint.sh diff --git a/cmd/postgres_exporter/tests/docker-postgres-replication/docker-entrypoint.sh b/cmd/postgres_exporter/tests/docker-postgres-replication/docker-entrypoint.sh index 0203e4b7..8a8d9f35 100755 --- a/cmd/postgres_exporter/tests/docker-postgres-replication/docker-entrypoint.sh +++ b/cmd/postgres_exporter/tests/docker-postgres-replication/docker-entrypoint.sh @@ -36,7 +36,7 @@ if [ "$1" = 'postgres' ]; then if [ "x$REPLICATE_FROM" == "x" ]; then eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" else - until ping -c 1 -W 1 ${REPLICATE_FROM} + until /bin/ping -c 1 -W 1 ${REPLICATE_FROM} do echo "Waiting for master to ping..." sleep 1s