Postgres with WAL-G installed and supporting scripts.
10K+
This image extends the stock Postgres Image and adds WAL-G support, along with some helpful scripts. It allows you to simply and easily create continuous, encrypted archives of Postgres databases in S3-compatible storage.
The source code is available here.
To use the image, you'll need to configure a bucket on your favorite S3- compatible provider, and set a few environment variables:
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that can read/write files
to your bucketAWS_ENDPOINT (et al) to tell WAL-G where to archive (see
WAL-G documentation for details)WALG_S3_PREFIX to tell WAL-G which bucket and prefix you'd like to useWALG_LIBSODIUM_KEY to encrypt the files stored in S3In your /var/lib/postgresql/data/pgsql/postgresql.conf file, set your archive
settings.
Importantly, you should set archive_mode = on and
archive_command = 'wal-g wal-push %p'. This will
tell Postgres to have WAL-G send WAL files to S3.
To run a full backup, simply run /wal-g/backup.sh.
These will happen automatically once you've started Postgres with your edited
postgresql.conf file (see
Configuration, above).
Testing recovery is simple: run a new Docker container with the correct
environment variables set and run /wal-g/recover.sh. It will:
At this point you should have high confidence that the recovery was successful.
If you start your recovered backup, be sure to turn archive_mode = off to avoid
pushing additional WAL files to S3!
Currently I build for Postgres 17, but you can build for whatever version that wal-g supports.
Content type
Image
Digest
sha256:c9504fdd3…
Size
206.7 MB
Last updated
about 1 month ago
docker pull koehn/postgres-wal-g:18.6-v3.0.9