11.5.0-centos-7-r71 release

This commit is contained in:
Bitnami Bot 2019-10-16 03:44:45 +00:00
parent e517c74484
commit bfdfa7d376
3 changed files with 44 additions and 14 deletions

View File

@ -1,4 +1,4 @@
FROM bitnami/centos-extras-base:7-r172
FROM bitnami/centos-extras-base:7-r173
LABEL maintainer "Bitnami <containers@bitnami.com>"
ENV BITNAMI_PKG_CHMOD="-R g+rwX" \
@ -15,7 +15,7 @@ COPY rootfs /
RUN yum --enablerepo base,updates,extras -y install epel-release && yum --enablerepo base,updates,extras -y update && yum --enablerepo base,updates -y install nss_wrapper
RUN /postunpack.sh
ENV BITNAMI_APP_NAME="postgresql" \
BITNAMI_IMAGE_VERSION="11.5.0-centos-7-r70" \
BITNAMI_IMAGE_VERSION="11.5.0-centos-7-r71" \
LANG="en_US.UTF-8" \
LANGUAGE="en_US:en" \
NAMI_PREFIX="/.nami" \

View File

@ -138,6 +138,11 @@ export POSTGRESQL_REPLICATION_USER="${POSTGRESQL_REPLICATION_USER:-}"
export POSTGRESQL_SYNCHRONOUS_COMMIT_MODE="${POSTGRESQL_SYNCHRONOUS_COMMIT_MODE:-on}"
export POSTGRESQL_FSYNC="${POSTGRESQL_FSYNC:-on}"
export POSTGRESQL_USERNAME="${POSTGRESQL_USERNAME:-postgres}"
# Version
export POSTGRESQL_VERSION="$(echo "$BITNAMI_IMAGE_VERSION" | grep -oP "^\d+\.\d+\.\d+")"
export POSTGRESQL_MAJOR_VERSION="$(echo "$BITNAMI_IMAGE_VERSION" | grep -oP "^\d+")"
EOF
if [[ -f "${POSTGRESQL_PASSWORD_FILE:-}" ]]; then
cat <<"EOF"
@ -474,6 +479,30 @@ postgresql_is_file_external() {
fi
}
########################
# Remove flags and postmaster files from a previous run (case of container restart)
# Globals:
# POSTGRESQL_*
# Arguments:
# None
# Returns:
# None
#########################
postgresql_clean_from_restart() {
local -r -a files=(
"$POSTGRESQL_DATA_DIR"/postmaster.pid
"$POSTGRESQL_DATA_DIR"/standby.signal
"$POSTGRESQL_DATA_DIR"/recovery.signal
)
for file in "${files[@]}"; do
if [[ -f "$file" ]]; then
postgresql_info "Cleaning stale $file file"
rm "$file"
fi
done
}
########################
# Ensure PostgreSQL is initialized
# Globals:
@ -485,7 +514,7 @@ postgresql_is_file_external() {
#########################
postgresql_initialize() {
postgresql_info "Initializing PostgreSQL database..."
postgresql_clean_from_restart
# This fixes an issue where the trap would kill the entrypoint.sh, if a PID was left over from a previous run
# Exec replaces the process without creating a new one, and when the container is restarted it may have the same PID
rm -f "$POSTGRESQL_PID_FILE"
@ -518,11 +547,6 @@ postgresql_initialize() {
if ! is_dir_empty "$POSTGRESQL_DATA_DIR"; then
postgresql_info "Deploying PostgreSQL with persisted data..."
local -r postmaster_path="$POSTGRESQL_DATA_DIR"/postmaster.pid
if [[ -f "$postmaster_path" ]]; then
postgresql_info "Cleaning stale postmaster.pid file"
rm "$postmaster_path"
fi
is_boolean_yes "$create_pghba_file" && postgresql_restrict_pghba
is_boolean_yes "$create_conf_file" && postgresql_configure_replication_parameters
is_boolean_yes "$create_conf_file" && postgresql_configure_fsync
@ -800,9 +824,15 @@ postgresql_slave_init_db() {
#########################
postgresql_configure_recovery() {
postgresql_info "Setting up streaming replication slave..."
cp -f "$POSTGRESQL_BASE_DIR/share/recovery.conf.sample" "$POSTGRESQL_RECOVERY_FILE"
chmod 600 "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "standby_mode" "on" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "primary_conninfo" "host=${POSTGRESQL_MASTER_HOST} port=${POSTGRESQL_MASTER_PORT_NUMBER} user=${POSTGRESQL_REPLICATION_USER} password=${POSTGRESQL_REPLICATION_PASSWORD} application_name=${POSTGRESQL_CLUSTER_APP_NAME}" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "trigger_file" "/tmp/postgresql.trigger.${POSTGRESQL_MASTER_PORT_NUMBER}" "$POSTGRESQL_RECOVERY_FILE"
if (( POSTGRESQL_MAJOR_VERSION >= 12 )); then
postgresql_set_property "primary_conninfo" "host=${POSTGRESQL_MASTER_HOST} port=${POSTGRESQL_MASTER_PORT_NUMBER} user=${POSTGRESQL_REPLICATION_USER} password=${POSTGRESQL_REPLICATION_PASSWORD} application_name=${POSTGRESQL_CLUSTER_APP_NAME}" "$POSTGRESQL_CONF_FILE"
postgresql_set_property "promote_trigger_file" "/tmp/postgresql.trigger.${POSTGRESQL_MASTER_PORT_NUMBER}" "$POSTGRESQL_CONF_FILE"
touch "$POSTGRESQL_DATA_DIR"/standby.signal
else
cp -f "$POSTGRESQL_BASE_DIR/share/recovery.conf.sample" "$POSTGRESQL_RECOVERY_FILE"
chmod 600 "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "standby_mode" "on" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "primary_conninfo" "host=${POSTGRESQL_MASTER_HOST} port=${POSTGRESQL_MASTER_PORT_NUMBER} user=${POSTGRESQL_REPLICATION_USER} password=${POSTGRESQL_REPLICATION_PASSWORD} application_name=${POSTGRESQL_CLUSTER_APP_NAME}" "$POSTGRESQL_RECOVERY_FILE"
postgresql_set_property "trigger_file" "/tmp/postgresql.trigger.${POSTGRESQL_MASTER_PORT_NUMBER}" "$POSTGRESQL_RECOVERY_FILE"
fi
}

View File

@ -49,7 +49,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t
* [`12-centos-7`, `12.0.0-centos-7-r0` (12/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/12.0.0-centos-7-r0/12/centos-7/Dockerfile)
* [`11-ol-7`, `11.5.0-ol-7-r76` (11/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.5.0-ol-7-r76/11/ol-7/Dockerfile)
* [`11-debian-9`, `11.5.0-debian-9-r69`, `11`, `11.5.0`, `11.5.0-r69`, `latest` (11/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.5.0-debian-9-r69/11/debian-9/Dockerfile)
* [`11-centos-7`, `11.5.0-centos-7-r70` (11/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.5.0-centos-7-r70/11/centos-7/Dockerfile)
* [`11-centos-7`, `11.5.0-centos-7-r71` (11/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/11.5.0-centos-7-r71/11/centos-7/Dockerfile)
* [`10-ol-7`, `10.10.0-ol-7-r74` (10/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/10.10.0-ol-7-r74/10/ol-7/Dockerfile)
* [`10-debian-9`, `10.10.0-debian-9-r70`, `10`, `10.10.0`, `10.10.0-r70` (10/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/10.10.0-debian-9-r70/10/debian-9/Dockerfile)
* [`10-centos-7`, `10.10.0-centos-7-r74` (10/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-postgresql/blob/10.10.0-centos-7-r74/10/centos-7/Dockerfile)