This image is largely inspired by this wal-g extension of the stock postgres image. However, instead of using the stock Postgres Image, it uses Bitnami's Postgres Image.
In addition to gaining from all the advatanages of using a Bitnami image, this image also:
With no extra environment variables, this image will just run in the same way as Bitnami's image. Every feature is opt-in by default.
Any environment that you pass to the container, will be picked up by wal-g. Please refer to their documentation in order to setup your S3 or S3 compatible storage for the backups.
There are two ways in which you can configure your container to run in archive mode:
ARCHIVE_MODE=true to apply a set of defaults to your configuration. The settings are:archive_mode = on
archive_command = 'wal-g wal-push %p'
archive_timeout = 60
Postgres physical replication requires both the physical files and a backup of WAL.
Wal-g manages these two as separate processes and, in order to fully restore your data, you'll need both.
By setting BACKUP_ON_INIT=true a full database backup will be performed on the first run of your container.
This script will only run once and it ensures that the recovery process has a base to build on.
Every time you change the configuration of your container (e.g.: postgresql.conf, pg_hba.conf, etc.) you'll need to perform the full backup again.
In order to recover the data, you only need to run the container in an empty volume with the command /recover.
For example:
docker run --rm \
-v <your_volume>:/bitnami/postgresql \
-e POSTGRESQL_PASSWORD=<password> \
-e AWS_ACCESS_KEY_ID=<key> \
-e AWS_SECRET_ACCESS_KEY=<secret> \
-e WALG_S3_PREFIX=s3://<bucket> \
-e AWS_ENDPOINT=https://<minio_endpoint> \
-e AWS_S3_FORCE_PATH_STYLE=true \
j3asolutions/bitnami-postgres-wal-g:12.2.0-debian-10-r67-0 /recover
This command will:
After the container has completed, you can start your other container as you wish by mounting the data volume in it. You may even use a different image in your other container if you wish.
Content type
Image
Digest
Size
94.2 MB
Last updated
over 6 years ago
docker pull j3asolutions/bitnami-postgres-wal-g:12.2.0-debian-10-r88-6