This repository contains the source code for the database backup Docker images used in the Control Plane Templates Catalog.
Built images are published to the GitHub Container Registry under ghcr.io/controlplane-com/backup-images.
| Image | Base | Tool |
|---|---|---|
mysql-backup |
mysql:8-debian |
mysqldump |
mongo-backup |
mongo:7-jammy |
mongodump |
postgres-backup |
postgres:18 |
pg_dumpall |
redis-backup |
redis:7-bookworm |
redis-cli --rdb |
tidb-backup |
debian:bookworm-slim |
TiDB BR |
Manticore Search: The backup source code for Manticore Search is maintained in a separate repository at github.com/controlplane-com/manticore-orchestrator.
Each image runs a single backup on container start and exits. They are intended to be run as cron jobs or one-shot workloads within Control Plane.
- MySQL, MongoDB, Redis — versioned independently of the database version, starting at
1.0and incremented sequentially (e.g.,1.0,1.1,1.2). - PostgreSQL — image versions are tied to the major PostgreSQL version. The minor version increments independently. For example,
17.1.0targetspostgres:17and18.1.0targetspostgres:18. - TiDB — image versions match the TiDB release. For example,
8.5.3corresponds topingcap/tidb:8.5.3.
All images support backing up to either AWS S3 or Google Cloud Storage. The target is controlled by the BACKUP_PROVIDER environment variable.
Cloud credentials must be available at runtime — either via workload identity (recommended) or by injecting the appropriate environment variables (AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY for AWS, or GOOGLE_APPLICATION_CREDENTIALS for GCP).
| Variable | Description |
|---|---|
BACKUP_PROVIDER |
aws or gcp |
BACKUP_BUCKET |
Bucket name |
BACKUP_PREFIX |
Path prefix within the bucket |
| Variable | Description |
|---|---|
MYSQL_HOST |
Database host |
MYSQL_PORT |
Database port |
MYSQL_ROOT_PASSWORD |
Root password |
| Variable | Description |
|---|---|
MONGO_URI |
Full connection URI (takes precedence if set) |
MONGO_HOST |
Database host (used if MONGO_URI is not set) |
MONGO_PORT |
Database port (default: 27017) |
MONGO_USER |
Username |
MONGO_PASSWORD |
Password |
MONGO_DB |
Specific database to back up (optional — backs up all if omitted) |
| Variable | Description |
|---|---|
PG_HOST |
Database host |
PG_PORT |
Database port |
PG_USER |
Username (default: root) |
PG_PASSWORD |
Password |
AWS_REGION |
Required when BACKUP_PROVIDER=aws |
| Variable | Description |
|---|---|
REDIS_HOST |
Redis host |
REDIS_PORT |
Redis port (default: 6379) |
REDIS_PASSWORD |
Password (optional) |
For Redis cluster mode, the following are also required:
| Variable | Description |
|---|---|
NUM_PRIMARIES |
Number of primary nodes in the cluster |
REDIS_WORKLOAD_NAME |
Control Plane workload name for the Redis statefulset |
CPLN_GVC |
Control Plane GVC name |
CPLN_LOCATION |
Control Plane location |
| Variable | Description |
|---|---|
TIDB_PD_ADDR |
PD server address |
AWS_REGION |
Required when BACKUP_PROVIDER=aws |
backups/
├── mongo-backup/
│ ├── Dockerfile
│ └── backup.sh
├── mysql-backup/
│ ├── Dockerfile
│ └── backup.sh
├── postgres-backup/
│ ├── Dockerfile
│ └── backup.sh
├── redis-backup/
│ ├── Dockerfile
│ └── backup.sh
└── tidb-backup/
├── Dockerfile
└── backup.sh
Use the Makefile to build and push images locally. Set REGISTRY, IMAGE, and TAG as needed:
# Build a single image
make build IMAGE=cockroach-backup
# Build and push
make build-push IMAGE=postgres-backup REGISTRY=ghcr.io/your-org TAG=v1.0.0
# Build or push all images
make build-all
make build-push-all REGISTRY=ghcr.io/your-org TAG=v1.0.0Valid IMAGE values: cockroach-backup, postgres-backup, redis-backup, mongo-backup, mysql-backup, tidb-backup.
To publish an image to GHCR, run the Publish Image workflow manually from the Actions tab:
- Go to Actions → Publish Image → Run workflow
- Enter the image name (e.g.
cockroach-backup) and the tag (e.g.1.0.0) - Click Run workflow
The image will be pushed to ghcr.io/controlplane-com/backup-images/<image>:<tag>.
Pull requests are welcome. If you are fixing a bug or adding support for a new provider, please:
- Fork the repo and create a branch from
main. - Test your changes by building the image locally:
make build IMAGE=<db>-backup
- Open a pull request with a clear description of the change.
Full documentation for template backups, including how to configure cron jobs and cloud credentials in Control Plane, can be found at docs.controlplane.com/template-catalog.