Skip to content

docker-mariadb-snapshot Documentation

docker-mariadb-snapshot logo

CI

A Docker image that wraps mariadb-dump/mysqldump and rsnapshot to provide a drop-in solution for periodic snapshots of MariaDB/MySQL databases with automated rotation and retention.

The primary goals of docker-mariadb-snapshot are reliability, simplicity, and ease of use.

Your Responsibility

Please review the Important Considerations document. This package has not been reviewed for all possible use cases and environments. It should be considered an example, rather than a production-ready tool. Please ensure that you audit this package and how you deploy it against your specific environment and requirements.

Compatibility

This image leverages mariadb-dump for database exports, which is compatible with both MariaDB and MySQL servers. For detailed version compatibility information, see the Compatibility document.

Quick Navigation

How It Works

The image leverages rsnapshot for snapshot rotation and mariadb-dump for database exports. When run with a frequency argument (hourly, daily, weekly, monthly), it:

  1. Connects to your MariaDB/MySQL server
  2. Selects databases based on your configuration mode
  3. Applies structure-only table rules if configured
  4. Dumps each database to a .sql file, applying compression if configured
  5. Generates a snapshot-metadata.json file with snapshot details, timing, and configuration
  6. Rotates snapshots according to retention policies
  7. Stores snapshots in timestamped directories (e.g., hourly.0/, hourly.1/)

License

This project is licensed under the MIT License.