mirror of
https://github.com/bitnami/containers.git
synced 2026-03-10 06:59:47 +08:00
4.0.6-centos-7-r43 release
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM bitnami/centos-extras-base:7-r166
|
||||
FROM bitnami/centos-extras-base:7-r167
|
||||
LABEL maintainer "Bitnami <containers@bitnami.com>"
|
||||
|
||||
ENV OS_ARCH="x86_64" \
|
||||
@@ -13,7 +13,7 @@ RUN . ./libcomponent.sh && component_unpack "pgpool" "4.0.6-1" --checksum 5270b5
|
||||
COPY rootfs /
|
||||
RUN /postunpack.sh
|
||||
ENV BITNAMI_APP_NAME="pgpool" \
|
||||
BITNAMI_IMAGE_VERSION="4.0.6-centos-7-r42" \
|
||||
BITNAMI_IMAGE_VERSION="4.0.6-centos-7-r43" \
|
||||
PATH="/opt/bitnami/postgresql/bin:/opt/bitnami/pgpool/bin:$PATH"
|
||||
|
||||
EXPOSE 5432
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
version: '2'
|
||||
services:
|
||||
pg-0:
|
||||
image: bitnami/postgresql-repmgr:4-centos-7
|
||||
image: bitnami/postgresql-repmgr:11-centos-7
|
||||
ports:
|
||||
- 5432
|
||||
volumes:
|
||||
@@ -17,7 +17,7 @@ services:
|
||||
- REPMGR_NODE_NAME=pg-0
|
||||
- REPMGR_NODE_NETWORK_NAME=pg-0
|
||||
pg-1:
|
||||
image: bitnami/postgresql-repmgr:4-centos-7
|
||||
image: bitnami/postgresql-repmgr:11-centos-7
|
||||
ports:
|
||||
- 5432
|
||||
volumes:
|
||||
@@ -38,11 +38,13 @@ services:
|
||||
- 5432:5432
|
||||
environment:
|
||||
- PGPOOL_BACKEND_NODES=0:pg-0:5432,1:pg-1:5432
|
||||
- PGPOOL_SR_CHECK_USER=postgres
|
||||
- PGPOOL_SR_CHECK_PASSWORD=adminpassword
|
||||
- PGPOOL_SR_CHECK_USER=customuser
|
||||
- PGPOOL_SR_CHECK_PASSWORD=custompassword
|
||||
- PGPOOL_ENABLE_LDAP=no
|
||||
- PGPOOL_USERNAME=customuser
|
||||
- PGPOOL_PASSWORD=custompassword
|
||||
- PGPOOL_POSTGRES_USERNAME=postgres
|
||||
- PGPOOL_POSTGRES_PASSWORD=adminpassword
|
||||
- PGPOOL_ADMIN_USERNAME=admin
|
||||
- PGPOOL_ADMIN_PASSWORD=adminpassword
|
||||
volumes:
|
||||
pg_0_data:
|
||||
driver: local
|
||||
|
||||
@@ -30,10 +30,12 @@ MODULE=pgpool
|
||||
export PGPOOL_BASE_DIR="/opt/bitnami/pgpool"
|
||||
export PGPOOL_DATA_DIR="${PGPOOL_BASE_DIR}/data"
|
||||
export PGPOOL_CONF_DIR="${PGPOOL_BASE_DIR}/conf"
|
||||
export PGPOOL_ETC_DIR="${PGPOOL_BASE_DIR}/etc"
|
||||
export PGPOOL_LOG_DIR="${PGPOOL_BASE_DIR}/logs"
|
||||
export PGPOOL_TMP_DIR="${PGPOOL_BASE_DIR}/tmp"
|
||||
export PGPOOL_BIN_DIR="${PGPOOL_BASE_DIR}/bin"
|
||||
export PGPOOL_CONF_FILE="${PGPOOL_CONF_DIR}/pgpool.conf"
|
||||
export PGPOOL_PCP_CONF_FILE="${PGPOOL_ETC_DIR}/pcp.conf"
|
||||
export PGPOOL_PGHBA_FILE="${PGPOOL_CONF_DIR}/pool_hba.conf"
|
||||
export PGPOOL_PID_FILE="${PGPOOL_TMP_DIR}/pgpool.pid"
|
||||
export PGPOOL_LOG_FILE="${PGPOOL_LOG_DIR}/pgpool.log"
|
||||
@@ -48,7 +50,8 @@ export PGPOOL_DAEMON_GROUP="pgpool"
|
||||
export PGPOOL_PORT_NUMBER="${PGPOOL_PORT_NUMBER:-5432}"
|
||||
export PGPOOL_BACKEND_NODES="${PGPOOL_BACKEND_NODES:-}"
|
||||
export PGPOOL_SR_CHECK_USER="${PGPOOL_SR_CHECK_USER:-}"
|
||||
export PGPOOL_USERNAME="${PGPOOL_USERNAME:-postgres}"
|
||||
export PGPOOL_POSTGRES_USERNAME="${PGPOOL_POSTGRES_USERNAME:-postgres}"
|
||||
export PGPOOL_ADMIN_USERNAME="${PGPOOL_ADMIN_USERNAME:-}"
|
||||
export PGPOOL_ENABLE_LDAP="${PGPOOL_ENABLE_LDAP:-no}"
|
||||
export PGPOOL_TIMEOUT="360"
|
||||
|
||||
@@ -63,13 +66,22 @@ export PGPOOL_LDAP_SCOPE="${PGPOOL_LDAP_SCOPE:-}"
|
||||
export PGPOOL_LDAP_TLS_REQCERT="${PGPOOL_LDAP_TLS_REQCERT:-}"
|
||||
|
||||
EOF
|
||||
if [[ -f "${PGPOOL_PASSWORD_FILE:-}" ]]; then
|
||||
if [[ -f "${PGPOOL_ADMIN_PASSWORD_FILE:-}" ]]; then
|
||||
cat << "EOF"
|
||||
export PGPOOL_PASSWORD="$(< "${PGPOOL_PASSWORD_FILE}")"
|
||||
export PGPOOL_ADMIN_PASSWORD="$(< "${PGPOOL_ADMIN_PASSWORD_FILE}")"
|
||||
EOF
|
||||
else
|
||||
cat << "EOF"
|
||||
export PGPOOL_PASSWORD="${PGPOOL_PASSWORD:-}"
|
||||
export PGPOOL_ADMIN_PASSWORD="${PGPOOL_ADMIN_PASSWORD:-}"
|
||||
EOF
|
||||
fi
|
||||
if [[ -f "${PGPOOL_POSTGRES_PASSWORD_FILE:-}" ]]; then
|
||||
cat << "EOF"
|
||||
export PGPOOL_POSTGRES_PASSWORD="$(< "${PGPOOL_POSTGRES_PASSWORD_FILE}")"
|
||||
EOF
|
||||
else
|
||||
cat << "EOF"
|
||||
export PGPOOL_POSTGRES_PASSWORD="${PGPOOL_POSTGRES_PASSWORD:-}"
|
||||
EOF
|
||||
fi
|
||||
if [[ -f "${PGPOOL_SR_CHECK_PASSWORD_FILE:-}" ]]; then
|
||||
@@ -102,17 +114,17 @@ pgpool_validate() {
|
||||
error_code=1
|
||||
}
|
||||
|
||||
if [[ -z "$PGPOOL_ADMIN_USERNAME" ]] || [[ -z "$PGPOOL_ADMIN_PASSWORD" ]]; then
|
||||
print_validation_error "The Pgpool administrator user's credentials are mandatory. Set the environment variables PGPOOL_ADMIN_USERNAME and PGPOOL_ADMIN_PASSWORD with the Pgpool administrator user's credentials."
|
||||
fi
|
||||
if [[ -z "$PGPOOL_SR_CHECK_USER" ]] || [[ -z "$PGPOOL_SR_CHECK_PASSWORD" ]]; then
|
||||
print_validation_error "The PostrgreSQL replication credentials are mandatory. Set the environment variables PGPOOL_SR_CHECK_USER and PGPOOL_SR_CHECK_PASSWORD with the PostrgreSQL replication credentials."
|
||||
fi
|
||||
if is_boolean_yes "$PGPOOL_ENABLE_LDAP"; then
|
||||
if [[ -z "${PGPOOL_LDAP_URI}" ]] || [[ -z "${PGPOOL_LDAP_BASE}" ]] || [[ -z "${PGPOOL_LDAP_BIND_DN}" ]] || [[ -z "${PGPOOL_LDAP_BIND_PASSWORD}" ]]; then
|
||||
print_validation_error "The LDAP configuration is required when LDAP authentication is enabled. Set the environment variables PGPOOL_LDAP_URI, PGPOOL_LDAP_BASE, PGPOOL_LDAP_BIND_DN and PGPOOL_LDAP_BIND_PASSWORD with the LDAP configuration."
|
||||
fi
|
||||
else
|
||||
if [[ -z "$PGPOOL_USERNAME" ]] || [[ -z "$PGPOOL_PASSWORD" ]]; then
|
||||
print_validation_error "The database credentials are required when LDAP authentication is not enabled. Set the environment variables PGPOOL_USERNAME and PGPOOL_PASSWORD with the database credentials."
|
||||
fi
|
||||
if is_boolean_yes "$PGPOOL_ENABLE_LDAP" && ( [[ -z "${PGPOOL_LDAP_URI}" ]] || [[ -z "${PGPOOL_LDAP_BASE}" ]] || [[ -z "${PGPOOL_LDAP_BIND_DN}" ]] || [[ -z "${PGPOOL_LDAP_BIND_PASSWORD}" ]] ); then
|
||||
print_validation_error "The LDAP configuration is required when LDAP authentication is enabled. Set the environment variables PGPOOL_LDAP_URI, PGPOOL_LDAP_BASE, PGPOOL_LDAP_BIND_DN and PGPOOL_LDAP_BIND_PASSWORD with the LDAP configuration."
|
||||
fi
|
||||
if [[ -z "$PGPOOL_POSTGRES_USERNAME" ]] || [[ -z "$PGPOOL_POSTGRES_PASSWORD" ]]; then
|
||||
print_validation_error "The administrator's database credentials are required. Set the environment variables PGPOOL_POSTGRES_USERNAME and PGPOOL_POSTGRES_PASSWORD with the administrator's database credentials."
|
||||
fi
|
||||
if [[ -z "$PGPOOL_BACKEND_NODES" ]]; then
|
||||
print_validation_error "The list of backend nodes cannot be empty. Set the environment variable PGPOOL_BACKEND_NODES with a comma separated list of backend nodes."
|
||||
@@ -161,7 +173,7 @@ pgpool_create_pghba() {
|
||||
cat > "$PGPOOL_PGHBA_FILE" << EOF
|
||||
local all all trust
|
||||
host all $PGPOOL_SR_CHECK_USER all trust
|
||||
host all $PGPOOL_USERNAME all trust
|
||||
host all $PGPOOL_POSTGRES_USERNAME all md5
|
||||
host all wide all trust
|
||||
host all pop_user all trust
|
||||
host all all all $authentication
|
||||
@@ -348,7 +360,7 @@ EOF
|
||||
}
|
||||
|
||||
########################
|
||||
# Configure LDAP connections
|
||||
# Generates a password file for local authentication
|
||||
# Globals:
|
||||
# PGPOOL_*
|
||||
# Arguments:
|
||||
@@ -357,9 +369,28 @@ EOF
|
||||
# None
|
||||
#########################
|
||||
pgpool_generate_password_file() {
|
||||
info "Generating password file for pgpool..."
|
||||
info "Generating password file for local authentication..."
|
||||
|
||||
pg_md5 -m --config-file="$PGPOOL_CONF_FILE" -u "$PGPOOL_USERNAME" "$PGPOOL_PASSWORD"
|
||||
pg_md5 -m --config-file="$PGPOOL_CONF_FILE" -u "$PGPOOL_POSTGRES_USERNAME" "$PGPOOL_POSTGRES_PASSWORD"
|
||||
}
|
||||
|
||||
########################
|
||||
# Generate a password file for pgpool admin user
|
||||
# Globals:
|
||||
# PGPOOL_*
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
pgpool_generate_admin_password_file() {
|
||||
info "Generating password file for pgpool admin user..."
|
||||
local passwd
|
||||
|
||||
passwd=$(pg_md5 "$PGPOOL_ADMIN_PASSWORD")
|
||||
cat >>"$PGPOOL_PCP_CONF_FILE"<<EOF
|
||||
$PGPOOL_ADMIN_USERNAME:$passwd
|
||||
EOF
|
||||
}
|
||||
|
||||
########################
|
||||
@@ -392,5 +423,6 @@ pgpool_initialize() {
|
||||
pgpool_ldap_config
|
||||
fi
|
||||
pgpool_generate_password_file
|
||||
pgpool_generate_admin_password_file
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t
|
||||
|
||||
* [`4-ol-7`, `4.0.6-ol-7-r42` (4/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-pgpool/blob/4.0.6-ol-7-r42/4/ol-7/Dockerfile)
|
||||
* [`4-debian-9`, `4.0.6-debian-9-r39`, `4`, `4.0.6`, `4.0.6-r39`, `latest` (4/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-pgpool/blob/4.0.6-debian-9-r39/4/debian-9/Dockerfile)
|
||||
* [`4-centos-7`, `4.0.6-centos-7-r42` (4/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-pgpool/blob/4.0.6-centos-7-r42/4/centos-7/Dockerfile)
|
||||
* [`4-centos-7`, `4.0.6-centos-7-r43` (4/centos-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-pgpool/blob/4.0.6-centos-7-r43/4/centos-7/Dockerfile)
|
||||
|
||||
Subscribe to project updates by watching the [bitnami/pgpool GitHub repo](https://github.com/bitnami/bitnami-docker-pgpool).
|
||||
|
||||
@@ -120,11 +120,13 @@ Use the `--network <NETWORK>` argument to the `docker run` command to attach the
|
||||
$ docker run --detach --rm --name pgpool \
|
||||
--network my-network \
|
||||
--env PGPOOL_BACKEND_NODES=0:pg-0:5432,1:pg-1:5432 \
|
||||
--env PGPOOL_SR_CHECK_USER=postgres \
|
||||
--env PGPOOL_SR_CHECK_PASSWORD=adminpassword \
|
||||
--env PGPOOL_SR_CHECK_USER=customuser \
|
||||
--env PGPOOL_SR_CHECK_PASSWORD=custompassword \
|
||||
--env PGPOOL_ENABLE_LDAP=no \
|
||||
--env PGPOOL_USERNAME=customuser \
|
||||
--env PGPOOL_PASSWORD=custompassword \
|
||||
--env PGPOOL_POSTGRES_USERNAME=postgres \
|
||||
--env PGPOOL_POSTGRES_PASSWORD=adminpassword \
|
||||
--env PGPOOL_ADMIN_USERNAME=admin \
|
||||
--env PGPOOL_ADMIN_PASSWORD=adminpassword \
|
||||
bitnami/pgpool:latest
|
||||
```
|
||||
|
||||
@@ -149,12 +151,13 @@ version: '2'
|
||||
networks:
|
||||
my-network:
|
||||
driver: bridge
|
||||
|
||||
services:
|
||||
postgresql:
|
||||
image: bitnami/postgresql-repmgr:4
|
||||
pg-0:
|
||||
image: bitnami/postgresql-repmgr:11
|
||||
ports:
|
||||
- 5432
|
||||
volumes:
|
||||
- pg_0_data:/bitnami/postgresql
|
||||
environment:
|
||||
- POSTGRESQL_POSTGRES_PASSWORD=adminpassword
|
||||
- POSTGRESQL_USERNAME=customuser
|
||||
@@ -162,24 +165,47 @@ services:
|
||||
- POSTGRESQL_DATABASE=customdatabase
|
||||
- REPMGR_PASSWORD=repmgrpassword
|
||||
- REPMGR_PRIMARY_HOST=pg-0
|
||||
- REPMGR_PARTNER_NODES=pg-0
|
||||
- REPMGR_PARTNER_NODES=pg-0,pg-1
|
||||
- REPMGR_NODE_NAME=pg-0
|
||||
- REPMGR_NODE_NETWORK_NAME=pg-0
|
||||
pgpool:
|
||||
image: 'bitnami/pgpool:latest'
|
||||
networks:
|
||||
- my-network
|
||||
pg-1:
|
||||
image: bitnami/postgresql-repmgr:11
|
||||
ports:
|
||||
- 5432
|
||||
volumes:
|
||||
- pg_1_data:/bitnami/postgresql
|
||||
environment:
|
||||
- PGPOOL_BACKEND_NODES=0:pg-0:5432
|
||||
- PGPOOL_SR_CHECK_USER=postgres
|
||||
- PGPOOL_SR_CHECK_PASSWORD=adminpassword
|
||||
- POSTGRESQL_POSTGRES_PASSWORD=adminpassword
|
||||
- POSTGRESQL_USERNAME=customuser
|
||||
- POSTGRESQL_PASSWORD=custompassword
|
||||
- POSTGRESQL_DATABASE=customdatabase
|
||||
- REPMGR_PASSWORD=repmgrpassword
|
||||
- REPMGR_PRIMARY_HOST=pg-0
|
||||
- REPMGR_PARTNER_NODES=pg-0,pg-1
|
||||
- REPMGR_NODE_NAME=pg-1
|
||||
- REPMGR_NODE_NETWORK_NAME=pg-1
|
||||
pgpool:
|
||||
image: bitnami/pgpool:4
|
||||
ports:
|
||||
- 5432:5432
|
||||
environment:
|
||||
- PGPOOL_BACKEND_NODES=0:pg-0:5432,1:pg-1:5432
|
||||
- PGPOOL_SR_CHECK_USER=customuser
|
||||
- PGPOOL_SR_CHECK_PASSWORD=custompassword
|
||||
- PGPOOL_ENABLE_LDAP=no
|
||||
- PGPOOL_USERNAME=customuser
|
||||
- PGPOOL_PASSWORD=custompassword
|
||||
- PGPOOL_POSTGRES_USERNAME=postgres
|
||||
- PGPOOL_POSTGRES_PASSWORD=adminpassword
|
||||
- PGPOOL_ADMIN_USERNAME=admin
|
||||
- PGPOOL_ADMIN_PASSWORD=adminpassword
|
||||
myapp:
|
||||
image: 'YOUR_APPLICATION_IMAGE'
|
||||
networks:
|
||||
- my-network
|
||||
volumes:
|
||||
pg_0_data:
|
||||
driver: local
|
||||
pg_1_data:
|
||||
driver: local
|
||||
```
|
||||
|
||||
> **IMPORTANT**:
|
||||
@@ -201,14 +227,17 @@ A HA PostgreSQL cluster with Pgpool, [Streaming replication](https://www.postgre
|
||||
|
||||
Pgpool:
|
||||
|
||||
- `PGPOOL_USERNAME`: Custom database username. No defaults.
|
||||
- `PGPOOL_PASSWORD`: Password for the custom user set in the `PGPOOL_USERNAME` environment variable. No defaults.
|
||||
- `PGPOOL_PASSWORD_FILE`: Path to a file that contains the password for the custom user set in the `PGPOOL_USERNAME` environment variable. This will override the value specified in `PGPOOL_PASSWORD`. No defaults.
|
||||
- `PGPOOL_SR_CHECK_USER`: Username to use to perform streaming checks. No defaults.
|
||||
- `PGPOOL_SR_CHECK_PASSWORD`: Password to use to perform streaming checks. No defaults.
|
||||
- `PGPOOL_SR_CHECK_PASSWORD_FILE`: Path to a file that contains the password to use to perform streaming checks. This will override the value specified in `PGPOOL_SR_CHECK_PASSWORD`. No defaults.
|
||||
- `PGPOOL_BACKEND_NODES`: Comma separated list of backend nodes in the cluster. No defaults.
|
||||
- `PGPOOL_ENABLE_LDAP`: Whether to enable LDAP authentication. Defaults to `no`.
|
||||
- `PGPOOL_POSTGRES_USERNAME`: Postgres administrator user name, this will be use to allow postgres admin authentication through Pgpool.
|
||||
- `PGPOOL_POSTGRES_PASSWORD`: Password for the user set in `PGPOOL_POSTGRES_USERNAME` environment variable. No defaults.
|
||||
- `PGPOOL_ADMIN_USERNAME`: Username for the pgpool administrator. No defaults.
|
||||
- `PGPOOL_ADMIN_PASSWORD`: Password for the user set in `PGPOOL_ADMIN_USERNAME` environment variable. No defaults.
|
||||
|
||||
|
||||
PostgreSQL with Replication Manager:
|
||||
|
||||
@@ -372,11 +401,14 @@ Please see the list of environment variables available in the Bitnami Pgpool con
|
||||
| PGPOOL_SR_CHECK_USER | `nil` |
|
||||
| PGPOOL_SR_CHECK_PASSWORD | `nil` |
|
||||
| PGPOOL_SR_CHECK_PASSWORD_FILE | `nil` |
|
||||
| PGPOOL_USERNAME | `nil` |
|
||||
| PGPOOL_PASSWORD | `nil` |
|
||||
| PGPOOL_POSTGRES_USERNAME | `nil` |
|
||||
| PGPOOL_POSTGRES_PASSWORD | `nil` |
|
||||
| PGPOOL_PASSWORD_FILE | `nil` |
|
||||
| PGPOOL_TIMEOUT | `360` |
|
||||
| PGPOOL_ENABLE_LDAP | `no` |
|
||||
| PGPOOL_ADMIN_USERNAME=admin | `nil` |
|
||||
| PGPOOL_ADMIN_PASSWORD=adminpassword | `nil` |
|
||||
|
||||
|
||||
# Logging
|
||||
|
||||
|
||||
Reference in New Issue
Block a user