From 81825c3292bb5df3a821ce11da44457941298b28 Mon Sep 17 00:00:00 2001 From: Laurianti Date: Wed, 24 Apr 2024 17:18:58 +0200 Subject: [PATCH] Fix Bitnami repmgr --- bitnami/Dockerfile | 5 +---- bitnami/timescaledb-bitnami-entrypoint.sh | 4 ++-- docker-entrypoint-initdb.d/000_install_timescaledb.sh | 11 ++++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/bitnami/Dockerfile b/bitnami/Dockerfile index d486592..399fab6 100644 --- a/bitnami/Dockerfile +++ b/bitnami/Dockerfile @@ -111,7 +111,4 @@ FROM timescale AS timescale-postgresql-repmgr ENTRYPOINT [ "/opt/bitnami/scripts/timescale/timescaledb-bitnami-entrypoint.sh" ] CMD [ "/opt/bitnami/scripts/postgresql-repmgr/run.sh" ] -FROM timescale-${PG_BASE_IMAGE} -ARG PG_BASE_IMAGE -ENV PG_BASE_IMAGE=${PG_BASE_IMAGE} -ENV PG_ORIGINAL_ENTRYPOINT_PATH="/opt/bitnami/scripts/${PG_BASE_IMAGE}" +FROM timescale-${PG_BASE_IMAGE} \ No newline at end of file diff --git a/bitnami/timescaledb-bitnami-entrypoint.sh b/bitnami/timescaledb-bitnami-entrypoint.sh index c368f1e..977c633 100755 --- a/bitnami/timescaledb-bitnami-entrypoint.sh +++ b/bitnami/timescaledb-bitnami-entrypoint.sh @@ -12,11 +12,11 @@ export POSTGRESQL_SHARED_PRELOAD_LIBRARIES # Timescale tuning breaks standby nodes on repmgr clusters, so we disable it # by default -if [ "$PG_BASE_IMAGE" == "postgresql-repmgr" ] +if [ "$BITNAMI_APP_NAME" == "postgresql-repmgr" ] then export NO_TS_TUNE=true fi # Fall through to the original entrypoint. Note that we use exec here because # this wrapper script shouldn't change PID 1 of the container. -exec "${PG_ORIGINAL_ENTRYPOINT_PATH}/entrypoint.sh" "$@" +exec "/opt/bitnami/scripts/${BITNAMI_APP_NAME}/entrypoint.sh" "$@" diff --git a/docker-entrypoint-initdb.d/000_install_timescaledb.sh b/docker-entrypoint-initdb.d/000_install_timescaledb.sh index e71ffc8..a2c1505 100644 --- a/docker-entrypoint-initdb.d/000_install_timescaledb.sh +++ b/docker-entrypoint-initdb.d/000_install_timescaledb.sh @@ -5,11 +5,7 @@ create_sql=`mktemp` # Checks to support bitnami image with same scripts so they stay in sync if [ ! -z "${BITNAMI_APP_NAME:-}" ]; then if [ -z "${POSTGRES_USER:-}" ]; then - POSTGRES_USER=postgres - fi - - if [ -z "${POSTGRESQL_PASSWORD:-}" ]; then - POSTGRESQL_PASSWORD=${POSTGRESQL_POSTGRES_PASSWORD} + POSTGRES_USER=${POSTGRESQL_USERNAME} fi if [ -z "${POSTGRES_DB:-}" ]; then @@ -21,6 +17,11 @@ if [ ! -z "${BITNAMI_APP_NAME:-}" ]; then fi fi +if [ "${BITNAMI_APP_NAME:-}" == "postgresql-repmgr" ]; then + POSTGRES_USER="postgres" + POSTGRESQL_PASSWORD=${POSTGRESQL_POSTGRES_PASSWORD} +fi + if [ -z "${POSTGRESQL_CONF_DIR:-}" ]; then POSTGRESQL_CONF_DIR=${PGDATA} fi