mirror of
https://github.com/bitnami/containers.git
synced 2026-03-31 14:57:47 +08:00
[bitnami/pgpool] Release 4.7.0-debian-12-r7 (#91062)
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
This commit is contained in:
@@ -7,7 +7,7 @@ ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith"
|
||||
ARG TARGETARCH
|
||||
|
||||
LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
|
||||
org.opencontainers.image.created="2026-02-19T03:44:20Z" \
|
||||
org.opencontainers.image.created="2026-02-24T11:00:11Z" \
|
||||
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
|
||||
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/pgpool/README.md" \
|
||||
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/pgpool" \
|
||||
@@ -30,7 +30,7 @@ RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
|
||||
COMPONENTS=( \
|
||||
"wait-for-port-1.0.10-7-linux-${OS_ARCH}-debian-12" \
|
||||
"postgresql-client-18.2.0-0-linux-${OS_ARCH}-debian-12" \
|
||||
"pgpool-4.7.0-0-linux-${OS_ARCH}-debian-12" \
|
||||
"pgpool-4.7.0-1-linux-${OS_ARCH}-debian-12" \
|
||||
) ; \
|
||||
for COMPONENT in "${COMPONENTS[@]}"; do \
|
||||
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
|
||||
@@ -51,7 +51,7 @@ COPY rootfs /
|
||||
RUN /opt/bitnami/scripts/pgpool/postunpack.sh
|
||||
ENV APP_VERSION="4.7.0" \
|
||||
BITNAMI_APP_NAME="pgpool" \
|
||||
IMAGE_REVISION="6" \
|
||||
IMAGE_REVISION="7" \
|
||||
LD_LIBRARY_PATH="/opt/bitnami/common/lib:/opt/bitnami/common/lib64:$LD_LIBRARY_PATH" \
|
||||
PATH="/opt/bitnami/common/bin:/opt/bitnami/postgresql/bin:/opt/bitnami/pgpool/bin:/opt/bitnami/common/sbin:$PATH"
|
||||
|
||||
|
||||
@@ -68,258 +68,22 @@ cd bitnami/APP/VERSION/OPERATING-SYSTEM
|
||||
docker build -t bitnami/APP:latest .
|
||||
```
|
||||
|
||||
## Using `docker-compose.yaml`
|
||||
|
||||
Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes.
|
||||
|
||||
## Connecting to other containers
|
||||
|
||||
Using [Docker container networking](https://docs.docker.com/engine/userguide/networking/), a different server running inside a container can easily be accessed by your application containers and vice-versa.
|
||||
|
||||
Containers attached to the same network can communicate with each other using the container name as the hostname.
|
||||
|
||||
### Using the Command Line
|
||||
|
||||
In this example, we will create a PostgreSQL client instance that will connect to the pgpool instance that is running on the same docker network as the client.
|
||||
|
||||
#### Step 1: Create a network
|
||||
|
||||
```console
|
||||
docker network create my-network --driver bridge
|
||||
```
|
||||
|
||||
#### Step 2: Launch 2 postgresql-repmgr containers to be used as backend within your network
|
||||
|
||||
Use the `--network <NETWORK>` argument to the `docker run` command to attach the container to the `my-network` network.
|
||||
|
||||
```console
|
||||
docker run --detach --rm --name pg-0 \
|
||||
--network my-network \
|
||||
--env REPMGR_PARTNER_NODES=pg-0,pg-1 \
|
||||
--env REPMGR_NODE_NAME=pg-0 \
|
||||
--env REPMGR_NODE_NETWORK_NAME=pg-0 \
|
||||
--env REPMGR_PRIMARY_HOST=pg-0 \
|
||||
--env REPMGR_PASSWORD=repmgrpass \
|
||||
--env POSTGRESQL_POSTGRES_PASSWORD=adminpassword \
|
||||
--env POSTGRESQL_USERNAME=customuser \
|
||||
--env POSTGRESQL_PASSWORD=custompassword \
|
||||
--env POSTGRESQL_DATABASE=customdatabase \
|
||||
bitnami/postgresql-repmgr:latest
|
||||
docker run --detach --rm --name pg-1 \
|
||||
--network my-network \
|
||||
--env REPMGR_PARTNER_NODES=pg-0,pg-1 \
|
||||
--env REPMGR_NODE_NAME=pg-1 \
|
||||
--env REPMGR_NODE_NETWORK_NAME=pg-1 \
|
||||
--env REPMGR_PRIMARY_HOST=pg-0 \
|
||||
--env REPMGR_PASSWORD=repmgrpass \
|
||||
--env POSTGRESQL_POSTGRES_PASSWORD=adminpassword \
|
||||
--env POSTGRESQL_USERNAME=customuser \
|
||||
--env POSTGRESQL_PASSWORD=custompassword \
|
||||
--env POSTGRESQL_DATABASE=customdatabase \
|
||||
bitnami/postgresql-repmgr:latest
|
||||
```
|
||||
|
||||
#### Step 3: Launch the pgpool container within your network
|
||||
|
||||
Use the `--network <NETWORK>` argument to the `docker run` command to attach the container to the `my-network` network.
|
||||
|
||||
```console
|
||||
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=customuser \
|
||||
--env PGPOOL_SR_CHECK_PASSWORD=custompassword \
|
||||
--env PGPOOL_ENABLE_LDAP=no \
|
||||
--env PGPOOL_POSTGRES_USERNAME=postgres \
|
||||
--env PGPOOL_POSTGRES_PASSWORD=adminpassword \
|
||||
--env PGPOOL_ADMIN_USERNAME=admin \
|
||||
--env PGPOOL_ADMIN_PASSWORD=adminpassword \
|
||||
bitnami/pgpool:latest
|
||||
```
|
||||
|
||||
#### Step 4: Launch your PostgreSQL client instance
|
||||
|
||||
Finally we create a new container instance to launch the PostgreSQL client and connect to the server created in the previous step:
|
||||
|
||||
```console
|
||||
docker run -it --rm \
|
||||
--network my-network \
|
||||
bitnami/postgresql:latest \
|
||||
psql -h pgpool -U customuser -d customdatabase
|
||||
```
|
||||
|
||||
### Using a Docker Compose file
|
||||
|
||||
When not specified, Docker Compose automatically sets up a new network and attaches all deployed services to that network. However, we will explicitly define a new `bridge` network named `my-network`. In this example we assume that you want to connect to the Pgpool-II server from your own custom application image which is identified in the following snippet by the service name `myapp`.
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
|
||||
networks:
|
||||
my-network:
|
||||
driver: bridge
|
||||
services:
|
||||
pg-0:
|
||||
image: bitnami/postgresql-repmgr:latest
|
||||
ports:
|
||||
- 5432
|
||||
volumes:
|
||||
- pg_0_data:/bitnami/postgresql
|
||||
environment:
|
||||
- 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-0
|
||||
- REPMGR_NODE_NETWORK_NAME=pg-0
|
||||
pg-1:
|
||||
image: bitnami/postgresql-repmgr:latest
|
||||
ports:
|
||||
- 5432
|
||||
volumes:
|
||||
- pg_1_data:/bitnami/postgresql
|
||||
environment:
|
||||
- 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:latest
|
||||
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_POSTGRES_USERNAME=postgres
|
||||
- PGPOOL_POSTGRES_PASSWORD=adminpassword
|
||||
- PGPOOL_ADMIN_USERNAME=admin
|
||||
- PGPOOL_ADMIN_PASSWORD=adminpassword
|
||||
healthcheck:
|
||||
test: ["CMD", "/opt/bitnami/scripts/pgpool/healthcheck.sh"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
myapp:
|
||||
image: YOUR_APPLICATION_IMAGE
|
||||
networks:
|
||||
- my-network
|
||||
volumes:
|
||||
pg_0_data:
|
||||
driver: local
|
||||
pg_1_data:
|
||||
driver: local
|
||||
```
|
||||
|
||||
> **IMPORTANT**:
|
||||
>
|
||||
> 1. Please update the **YOUR_APPLICATION_IMAGE_** placeholder in the above snippet with your application image
|
||||
> 2. In your application container, use the hostname `pgpool` to connect to the PostgreSQL server
|
||||
|
||||
Launch the containers using:
|
||||
|
||||
```console
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Setting up a HA PostgreSQL cluster with Pgpool-II, streaming replication and repmgr
|
||||
|
||||
A HA PostgreSQL cluster with Pgpool-II, [Streaming replication](https://www.postgresql.org/docs/10/warm-standby.html#STREAMING-REPLICATION) and [repmgr](https://repmgr.org) can easily be setup with the Bitnami PostgreSQL with Replication Manager and Pgpool-II container images.
|
||||
In a HA PostgreSQL cluster you can have one primary and zero or more standby nodes. The primary node is in read-write mode, while the standby nodes are in read-only mode. For best performance its advisable to limit the reads to the standby nodes.
|
||||
|
||||
#### Step 1: Create a network and the initial primary node
|
||||
|
||||
The first step is to start the initial primary node:
|
||||
|
||||
```console
|
||||
docker network create my-network --driver bridge
|
||||
docker run --detach --name pg-0 \
|
||||
--network my-network \
|
||||
--env REPMGR_PARTNER_NODES=pg-0,pg-1 \
|
||||
--env REPMGR_NODE_NAME=pg-0 \
|
||||
--env REPMGR_NODE_NETWORK_NAME=pg-0 \
|
||||
--env REPMGR_PRIMARY_HOST=pg-0 \
|
||||
--env REPMGR_PASSWORD=repmgrpass \
|
||||
--env POSTGRESQL_POSTGRES_PASSWORD=adminpassword \
|
||||
--env POSTGRESQL_USERNAME=customuser \
|
||||
--env POSTGRESQL_PASSWORD=custompassword \
|
||||
--env POSTGRESQL_DATABASE=customdatabase \
|
||||
bitnami/postgresql-repmgr:latest
|
||||
```
|
||||
|
||||
#### Step 2: Create a standby node
|
||||
|
||||
Next we start a standby node:
|
||||
|
||||
```console
|
||||
docker run --detach --name pg-1 \
|
||||
--network my-network \
|
||||
--env REPMGR_PARTNER_NODES=pg-0,pg-1 \
|
||||
--env REPMGR_NODE_NAME=pg-1 \
|
||||
--env REPMGR_NODE_NETWORK_NAME=pg-1 \
|
||||
--env REPMGR_PRIMARY_HOST=pg-0 \
|
||||
--env REPMGR_PASSWORD=repmgrpass \
|
||||
--env REPMGR_PASSWORD=repmgrpass \
|
||||
--env POSTGRESQL_POSTGRES_PASSWORD=adminpassword \
|
||||
--env POSTGRESQL_USERNAME=customuser \
|
||||
--env POSTGRESQL_PASSWORD=custompassword \
|
||||
--env POSTGRESQL_DATABASE=customdatabase \
|
||||
bitnami/postgresql-repmgr:latest
|
||||
```
|
||||
|
||||
#### Step 3: Create the pgpool instance
|
||||
|
||||
```console
|
||||
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_ENABLE_LDAP=no \
|
||||
--env PGPOOL_USERNAME=customuser \
|
||||
--env PGPOOL_PASSWORD=custompassword \
|
||||
bitnami/pgpool:latest
|
||||
```
|
||||
|
||||
With these three commands you now have a two node PostgreSQL primary-standby streaming replication cluster using Pgpool-II as proxy up and running. You can scale the cluster by adding/removing standby nodes without incurring any downtime.
|
||||
|
||||
> **Note**: The cluster replicates the primary in its entirety, which includes all users and databases.
|
||||
|
||||
If the master goes down, **repmgr** will ensure any of the standby nodes takes the primary role, guaranteeing high availability.
|
||||
|
||||
> **Note**: The configuration of the other nodes in the cluster needs to be updated so that they are aware of them. This would require you to restart the old nodes adapting the `REPMGR_PARTNER_NODES` environment variable. You also need to restart the Pgpoll instance adapting the `PGPOOL_BACKEND_NODES` environment variable.
|
||||
|
||||
With Docker Compose the HA PostgreSQL cluster can be setup using the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/pgpool/docker-compose.yml) file present in this repository:
|
||||
|
||||
```console
|
||||
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/pgpool/docker-compose.yml > docker-compose.yml
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Initializing with custom scripts
|
||||
|
||||
**Everytime the container is started**, it will execute the files with extension `.sh` located at `/docker-entrypoint-initdb.d` after initializing Pgpool-II.
|
||||
|
||||
In order to have your custom files inside the docker image you can mount them as a volume. With docker-compose:
|
||||
|
||||
```diff
|
||||
image: bitnami/pgpool:latest
|
||||
ports:
|
||||
- 5432:5432
|
||||
+ volumes:
|
||||
+ - /path/to/init-scripts:/docker-entrypoint-initdb.d
|
||||
environment:
|
||||
- PGPOOL_BACKEND_NODES=0:pg-0:5432,1:pg-1:5432
|
||||
- PGPOOL_SR_CHECK_USER=customuser
|
||||
```
|
||||
|
||||
### Securing Pgpool-II traffic
|
||||
|
||||
Pgpool-II supports the encryption of connections using the SSL/TLS protocol. Should you desire to enable this optional feature, you may use the following environment variables to configure the application:
|
||||
@@ -330,83 +94,14 @@ Pgpool-II supports the encryption of connections using the SSL/TLS protocol. Sho
|
||||
- `PGPOOL_TLS_CA_FILE`: File containing the CA of the certificate. If provided, Pgpool-II will authenticate TLS/SSL clients by requesting them a certificate (see [ref](https://www.pgpool.net/docs/latest/en/html/runtime-ssl.html)). No defaults.
|
||||
- `PGPOOL_TLS_PREFER_SERVER_CIPHERS`: Whether to use the server's TLS cipher preferences rather than the client's. Defaults to `yes`.
|
||||
|
||||
When enabling TLS, Pgpool-II will support both standard and encrypted traffic by default, but prefer the latter. Below there are some examples on how to quickly set up TLS traffic:
|
||||
|
||||
1. Using `docker run`
|
||||
|
||||
```console
|
||||
$ docker run \
|
||||
-v /path/to/certs:/opt/bitnami/pgpool/certs \
|
||||
-e ALLOW_EMPTY_PASSWORD=yes \
|
||||
-e PGPOOL_ENABLE_TLS=yes \
|
||||
-e PGPOOL_TLS_CERT_FILE=/opt/bitnami/pgpool/certs/postgres.crt \
|
||||
-e PGPOOL_TLS_KEY_FILE=/opt/bitnami/pgpool/certs/postgres.key \
|
||||
bitnami/pgpool:latest
|
||||
```
|
||||
|
||||
2. Modifying the `docker-compose.yml` file present in this repository:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
pgpool:
|
||||
...
|
||||
environment:
|
||||
...
|
||||
- PGPOOL_ENABLE_TLS=yes
|
||||
- PGPOOL_TLS_CERT_FILE=/opt/bitnami/pgpool/certs/postgres.crt
|
||||
- PGPOOL_TLS_KEY_FILE=/opt/bitnami/pgpool/certs/postgres.key
|
||||
...
|
||||
volumes:
|
||||
...
|
||||
- /path/to/certs:/opt/bitnami/pgpool/certs
|
||||
...
|
||||
```
|
||||
When enabling TLS, Pgpool-II will support both standard and encrypted traffic by default, but prefer the latter.
|
||||
|
||||
Alternatively, you may also provide this configuration in your [custom](https://github.com/bitnami/containers/blob/main/bitnami/pgpool#configuration-file) configuration file.
|
||||
|
||||
### Configuration file
|
||||
|
||||
You can override the default configuration by providing a configuration file. Set `PGPOOL_USER_CONF_FILE` with the path of the file, and this will be added to the default configuration.
|
||||
You can override the default hba configuration by providing a hba configuration file. Set `PGPOOL_USER_HBA_FILE` with the path of the file, and this will overwrite the default hba configuration.
|
||||
|
||||
### Step 1: Generate the configuration file
|
||||
|
||||
```console
|
||||
$ cat myconf.conf
|
||||
max_pool='300'
|
||||
```
|
||||
|
||||
#### Step 2: Run the Pgpool-II image
|
||||
|
||||
Run the Pgpool-II image, mounting a directory from your host and setting `PGPOOL_USER_CONF_FILE` and `PGPOOL_USER_HBA_FILE`. Using Docker Compose:
|
||||
|
||||
```diff
|
||||
image: bitnami/pgpool:latest
|
||||
ports:
|
||||
- 5432:5432
|
||||
+ volumes:
|
||||
+ - /path/to/myconf.conf:/config/myconf.conf
|
||||
+ - /path/to/myhbaconf.conf:/config/myhbaconf.conf
|
||||
environment:
|
||||
+ - PGPOOL_USER_CONF_FILE=/config/myconf.conf
|
||||
+ - PGPOOL_USER_HBA_FILE=/config/myhbaconf.conf
|
||||
- PGPOOL_BACKEND_NODES=0:pg-0:5432,1:pg-1:5432
|
||||
- PGPOOL_SR_CHECK_USER=customuser
|
||||
```
|
||||
|
||||
#### Step 3: Start Pgpool-II
|
||||
|
||||
Start your Pgpool-II container for changes to take effect.
|
||||
|
||||
```console
|
||||
docker restart pgpool
|
||||
```
|
||||
|
||||
or using Docker Compose:
|
||||
|
||||
```console
|
||||
docker-compose restart pgpool
|
||||
```
|
||||
You can also override the default hba configuration by providing a hba configuration file. Set `PGPOOL_USER_HBA_FILE` with the path of the file, and this will overwrite the default hba configuration.
|
||||
|
||||
Refer to the [server configuration](http://www.pgpool.net/docs/latest/en/html/runtime-config.html) manual for the complete list of configuration options.
|
||||
|
||||
@@ -542,40 +237,6 @@ docker logs pgpool
|
||||
|
||||
You can configure the containers [logging driver](https://docs.docker.com/engine/admin/logging/overview/) using the `--log-driver` option if you wish to consume the container logs differently. In the default configuration docker uses the `json-file` driver.
|
||||
|
||||
## Maintenance
|
||||
|
||||
### Upgrade this image
|
||||
|
||||
Bitnami provides up-to-date versions of Pgpool-II, including security patches, soon after they are made upstream. We recommend that you follow these steps to upgrade your container.
|
||||
|
||||
#### Step 1: Get the updated image
|
||||
|
||||
```console
|
||||
docker pull bitnami/pgpool:latest
|
||||
```
|
||||
|
||||
#### Step 2: Stop the running container
|
||||
|
||||
Stop the currently running container using the command
|
||||
|
||||
```console
|
||||
docker-compose stop pgpool
|
||||
```
|
||||
|
||||
#### Step 3: Remove the currently running container
|
||||
|
||||
```console
|
||||
docker-compose rm -v pgpool
|
||||
```
|
||||
|
||||
#### Step 4: Run the new image
|
||||
|
||||
Re-create your container from the new image.
|
||||
|
||||
```console
|
||||
docker-compose up pgpool
|
||||
```
|
||||
|
||||
## Notable Changes
|
||||
|
||||
### 4.3.1-debian-10-r67
|
||||
@@ -593,12 +254,6 @@ docker-compose up pgpool
|
||||
- `4.1.0-centos-7-r8` is considered the latest image based on CentOS.
|
||||
- Standard supported distros: Debian & OEL.
|
||||
|
||||
## Using `docker-compose.yaml`
|
||||
|
||||
Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes.
|
||||
|
||||
If you detect any issue in the `docker-compose.yaml` file, feel free to report it or contribute with a fix by following our [Contributing Guidelines](https://github.com/bitnami/containers/blob/main/CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2026 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
||||
|
||||
Reference in New Issue
Block a user