truii/postgres-backup
74
This docker image is built for both AMD64 and ARM64 architectures, allowing native execution on local M1/2/3 macos devices.
The following commands are used to build the images for both PG16 and PG13 on the archs listed above:
➜ docker buildx build --platform=linux/amd64,linux/arm64 . -t truii/postgres-backup:16
And for PG13, we need to specify a different ALPINE_VERSION
variable (along with the PGVERSION
env) to build without errors:
➜ docker buildx build --platform=linux/amd64,linux/arm64 . -t truii/postgres-backup:13 --build-arg ALPINE_VERSION=3.15 --build-arg PGVERSION=13
The image is available publicallyhere. There is no proprietary Truii code/secrets so there is no harm in making the image public. Because the image is built on the alpine plugin and installs the pg-client tools, the overall image is small meaning that docker can download the image in seconds. ~6MB for PG13 and ~8MB for PG16.
The output format of the dumps is a tar format. Support for customising the output format is not planned at this stage.
DATABASES
env variable/home
)YYYY-MM-DD_HH:MM
)To run this image, you will need to specify the following env variables (at a minimum):
DATABASES
- a comma separated list of database names to backupPGPASSWORD
- the password to the user to authenticate to postgresPGUSER
- the user to authenticate to postgresPGHOST
- the fully qualified domain name (fqdn) or ip address of the postgres hostOUTPUT_PATH
- (optional) change the location of the dump(s) location (default: /home
)docker pull truii/postgres-backup