A simple Docker container that runs server backups using simple-server-backup. The container runs the backup immediately when started and then exits.
docker run -v '<LOCAL_BACKUP_FOLDER>:/backups' ghcr.io/vkoop/docker-simplebackup:masterThis container does not handle scheduling internally. To schedule backups, use external scheduling mechanisms such as:
- Docker cron jobs
- Kubernetes CronJobs
- Host system's cron
- Any other external scheduling mechanism
# Run backup daily at 2 AM
0 2 * * * docker run --rm -v '/path/to/backups:/backups' ghcr.io/vkoop/docker-simplebackup:masterversion: '3'
services:
backup:
image: ghcr.io/vkoop/docker-simplebackup:master
volumes:
- ./backups:/backupsThen run with: docker-compose run --rm backup
A docker-compose.yml file is included in this repository that uses Ofelia to schedule backups. Ofelia is a Docker job scheduler that can run commands or services on a schedule.
The docker-compose.yml file configures:
- A backup service with the appropriate volume mounts
- Ofelia labels to schedule daily backups at 2 AM
- An Ofelia container that manages the scheduling
To use this setup:
# Start the containers
docker-compose up -d
# Check the scheduler logs
docker-compose logs -f ofeliaSee the docker-compose.yml file in this repository for the complete configuration.