PosgreSQL database dump with rolling backup (daily, weekly, monthly)
50K+
Docker image for PostgreSQL database rolling backup
Dockerfile links12, latest (12/Dockerfile)11, (11/Dockerfile)10.5, (10.5/Dockerfile)10.3, (10.3/Dockerfile)10.1, (10.1/Dockerfile)9.6, (9.6/Dockerfile)$ docker run -e POSTGRES_HOST=my_db_host -e POSTGRES_USER=my_db_user -e POSTGRES_PASSWORD=my_secret-password shelbert/postgres-rolling-backup
This image produces database backups into /var/lib/postgresql/backup folder. Use docker volume mapping to make dumps available to other containers or somewhere on the docker host.
This image is based on the postgres:12 official docker image and use postgre tools provided by this image.
$ docker run -v /path_to_backup_folder_on_docker_host:/var/lib/postgresql/backup -e POSTGRES_HOST=my_db_host -e POSTGRES_USER=my_db_user -e POSTGRES_PASSWORD=my_secret-password shelbert/postgres-rolling-backup
POSTGRES_HOSTOptional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified.
POSTGRES_USEROptional username to connect to database as. Will default to "postgres" if none specified.
POSTGRES_PASSWORDOptional password to connect to database as. Will default to empty if none specified.
BACKUP_DIROptional backup path. Will default to "/var/lib/postgresql/backup" if none specified.
BACKUP_GLOBALSIf set to "yes" (default value), will produce gzipped sql file containing the cluster globals, like users and passwords
BACKUP_RETENTION_DAY_OF_WEEK_TO_KEEPWhich day to take the weekly backup from (1-7 = Monday-Sunday). Will default to 5 if none specified.
BACKUP_RETENTION_DAY_OF_MONTH_TO_KEEPWhich day to take the monthly backup from. Will default to 1 if none specified.
BACKUP_RETENTION_DAILY_BACKUP_RETENTION_DAYSNumber of days to keep daily backups. Will default to 7 if none specified. available since postgres-rolling-backup:11
BACKUP_RETENTION_WEEKLY_BACKUP_RETENTION_DAYSNumber of days to keep weekly backups. Will default to 31 if none specified. available since postgres-rolling-backup:11
BACKUP_RETENTION_MONTHLY_BACKUP_RETENTION_DAYSNumber of days to keep monthly backups. Will default to 365 if none specified. available since postgres-rolling-backup:11
Content type
Image
Digest
Size
108.8 MB
Last updated
over 6 years ago
docker pull shelbert/postgres-rolling-backup