docker-barman

A pgbarman docker image with Prometheus metrics

What does this image do

After properly configured this image runs a cron with the cron command every minute. That "executes WAL archiving operations concurrently on a server basis, and this also enforces retention policies on those servers that have:

retention_policy not empty and valid;

retention_policy_mode set to auto.

The cron command ensures that WAL streaming is started for those servers that have requested it, by transparently executing the receive-wal command."

The image currently is focused on streaming replication so no rsync streaming or now.

How to use this image

For an full overview of using this image with a server check the example configuration for in the docker-compose.yml. If you run this compose file you will obtain two PostgresSQL servers and a Barman scheduled to make full backups every hour for server1 and every 6 hours to server2. Also a Prometheus server will be available to gather metrics from the exporter included in the image.

Configuring Barman

All ENV variables that starts with BARMAN_ will be converted read and converted to the correct format needed for barman.conf file. Example BARMAN_MINIMUM_REDUNDANCY=1 will be inserted as minimum_redundancy=1. Full list of options at pgbarman's manual.

Alternatively it is possible to mount a volume file in $BARMAN_BARMAN_HOME/.barman.conf that will override the base config file.

Configuring servers

For server configurations provide a file per server in /etc/barman.d/ as stated in the barman manual.

Additionaly you can pass a extra configuration in these files for scheduling backups: