Resticker Docker image patched with PostgreSQL database backup utilities
Find a file
2025-03-01 17:32:03 +11:00
bin Initial commit 2025-03-01 17:32:03 +11:00
Dockerfile Initial commit 2025-03-01 17:32:03 +11:00
LICENSE Initial commit 2025-03-01 17:32:03 +11:00
README.md Initial commit 2025-03-01 17:32:03 +11:00

resticker-pg

An adapted resticker Docker image built with a PostgreSQL client and pg_dump helper script to safely backup PostgreSQL databases without having to mount docker.sock.

Usage

Make sure to set the following environment variables:

  • DB_HOSTNAME
  • DB_USERNAME
  • DB_PASSWORD

DB_PORT can be used to set a non-standard database port.

This image is a drop-in replacement for resticker, and therefore will not attempt to dump a database (even if environment variables are provided) unless the script is explicitly called.

The database dump script is copied to /usr/local/bin/dump_pg_db.sh. To use it, add the following to the container's environment:

environment:
    # ...
    PRE_COMMANDS: |-
            /usr/local/bin/dump_pg_db.sh            
    # ...

The resulting dump is written to /data/db/DATABASE_NAME.sql within the container.

Credits

Base Dockerfile from https://github.com/djmaze/resticker [Apache-2.0 License]

Postgres backup/dump script adapted from https://github.com/ixc/restic-pg-dump-docker [MIT License]

License

This project is licensed under the MIT license.

See LICENSE.