diff --git a/bitnami/postgresql/13/debian-10/Dockerfile b/bitnami/postgresql/13/debian-10/Dockerfile index 981fdcbd260e..253a6e78bbd8 100644 --- a/bitnami/postgresql/13/debian-10/Dockerfile +++ b/bitnami/postgresql/13/debian-10/Dockerfile @@ -24,7 +24,7 @@ COPY rootfs / RUN /opt/bitnami/scripts/postgresql/postunpack.sh RUN /opt/bitnami/scripts/locales/add-extra-locales.sh ENV BITNAMI_APP_NAME="postgresql" \ - BITNAMI_IMAGE_VERSION="13.0.0-debian-10-r8" \ + BITNAMI_IMAGE_VERSION="13.0.0-debian-10-r9" \ LANG="en_US.UTF-8" \ LANGUAGE="en_US:en" \ NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \ diff --git a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh index 192ddf6b98ae..3d5090bad88a 100644 --- a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/libpostgresql.sh @@ -627,6 +627,7 @@ postgresql_initialize() { is_boolean_yes "$create_conf_file" && [[ -n "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" ]] && postgresql_set_property "shared_preload_libraries" "$POSTGRESQL_SHARED_PRELOAD_LIBRARIES" is_boolean_yes "$create_conf_file" && postgresql_configure_logging is_boolean_yes "$create_conf_file" && postgresql_configure_connections + is_boolean_yes "$create_conf_file" && postgresql_configure_timezone # Delete conf files generated on first run rm -f "$POSTGRESQL_DATA_DIR"/postgresql.conf "$POSTGRESQL_DATA_DIR"/pg_hba.conf @@ -707,8 +708,10 @@ postgresql_custom_init_scripts() { # None ######################### postgresql_stop() { - info "Stopping PostgreSQL..." - stop_service_using_pid "$POSTGRESQL_PID_FILE" + if [[ -f "$POSTGRESQL_PID_FILE" ]]; then + info "Stopping PostgreSQL..." + PGDATA="$POSTGRESQL_DATA_DIR" pg_ctl stop -w + fi } ######################## @@ -967,6 +970,19 @@ postgresql_configure_connections() { ([[ -n "$POSTGRESQL_STATEMENT_TIMEOUT" ]] && postgresql_set_property "statement_timeout" "$POSTGRESQL_STATEMENT_TIMEOUT") || true } +######################## +# Configure timezone +# Globals: +# POSTGRESQL_* +# Arguments: +# None +# Returns: +# Boolean +######################### +postgresql_configure_timezone() { + ([[ -n "$POSTGRESQL_TIMEZONE" ]] && postgresql_set_property "timezone" "$POSTGRESQL_TIMEZONE") || true +} + ######################## # Remove pg_hba.conf lines based on filter # Globals: diff --git a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh index e29f7b7a79da..99af7992f3e3 100644 --- a/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh +++ b/bitnami/postgresql/13/debian-10/rootfs/opt/bitnami/scripts/postgresql-env.sh @@ -68,6 +68,7 @@ postgresql_env_vars=( POSTGRESQL_CLIENT_MIN_MESSAGES POSTGRESQL_LOG_LINE_PREFIX POSTGRESQL_LOG_TIMEZONE + POSTGRESQL_TIMEZONE POSTGRESQL_MAX_CONNECTIONS POSTGRESQL_TCP_KEEPALIVES_IDLE POSTGRESQL_TCP_KEEPALIVES_INTERVAL @@ -128,6 +129,7 @@ postgresql_env_vars=( POSTGRES_CLIENT_MIN_MESSAGES POSTGRES_LOG_LINE_PREFIX POSTGRES_LOG_TIMEZONE + POSTGRES_TIMEZONE POSTGRES_MAX_CONNECTIONS POSTGRES_TCP_KEEPALIVES_IDLE POSTGRES_TCP_KEEPALIVES_INTERVAL @@ -271,6 +273,8 @@ POSTGRESQL_LOG_LINE_PREFIX="${POSTGRESQL_LOG_LINE_PREFIX:-"${POSTGRES_LOG_LINE_P export POSTGRESQL_LOG_LINE_PREFIX="${POSTGRESQL_LOG_LINE_PREFIX:-}" POSTGRESQL_LOG_TIMEZONE="${POSTGRESQL_LOG_TIMEZONE:-"${POSTGRES_LOG_TIMEZONE:-}"}" export POSTGRESQL_LOG_TIMEZONE="${POSTGRESQL_LOG_TIMEZONE:-}" +POSTGRESQL_TIMEZONE="${POSTGRESQL_TIMEZONE:-"${POSTGRES_TIMEZONE:-}"}" +export POSTGRESQL_TIMEZONE="${POSTGRESQL_TIMEZONE:-}" POSTGRESQL_MAX_CONNECTIONS="${POSTGRESQL_MAX_CONNECTIONS:-"${POSTGRES_MAX_CONNECTIONS:-}"}" export POSTGRESQL_MAX_CONNECTIONS="${POSTGRESQL_MAX_CONNECTIONS:-}" POSTGRESQL_TCP_KEEPALIVES_IDLE="${POSTGRESQL_TCP_KEEPALIVES_IDLE:-"${POSTGRES_TCP_KEEPALIVES_IDLE:-}"}" diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md index fd4e070a3a09..853569f0239d 100644 --- a/bitnami/postgresql/README.md +++ b/bitnami/postgresql/README.md @@ -44,7 +44,7 @@ Non-root container images add an extra layer of security and are generally recom Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/). -* [`13`, `13-debian-10`, `13.0.0`, `13.0.0-debian-10-r8` (13/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/13.0.0-debian-10-r8/13/debian-10/Dockerfile) +* [`13`, `13-debian-10`, `13.0.0`, `13.0.0-debian-10-r9` (13/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/13.0.0-debian-10-r9/13/debian-10/Dockerfile) * [`12`, `12-debian-10`, `12.4.0`, `12.4.0-debian-10-r60` (12/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/12.4.0-debian-10-r60/12/debian-10/Dockerfile) * [`11`, `11-debian-10`, `11.9.0`, `11.9.0-debian-10-r52`, `latest` (11/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.9.0-debian-10-r52/11/debian-10/Dockerfile) * [`10`, `10-debian-10`, `10.14.0`, `10.14.0-debian-10-r61` (10/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/10.14.0-debian-10-r61/10/debian-10/Dockerfile)