xylphid/backup

By xylphid

Updated 12 months ago

Lightweight Database Backup

Image
0

234

Backup

Backup is a simple lightweight tool to backup your databases.
It parses any of your running container to find databases, connects to each one of them and execute a simple backup using native provided tools.
Supported databases :

  • MariaDB
  • MySQL
  • MongoDB
  • PostgreSQL

It keeps :

  • The first backup of each month
  • The last 14 backups

This project support x86 and arm achitectures.

Supported tags

How to use this image

Environments

Here are supported environments variable and its definition :

  • CRONFIG : Crontab scheduling (default : "0 23 * * *")
Running the container
$ docker run -d --name backup \
    -v //var/run/docker.sock:/var/run//docker.sock \
    -v /path/tp/backups:/opt/backups
    xylphid/db-backup:1.5
How to compose with this image
version: "3"

services:
  cron:
    environment:
      CRONFIG: "0 23 * * *"
    image: xylphid/db-backup:1.5
    volumes:
      - //var/run/docker.sock:/var/run/docker.sock
      - backup-volume:/opt/backups/
Swarm reflexion

On swarm, you may use this image on global mode.

version: "3"

services:
  cron:
    deploy:
      mode: global
      restart_policy:
        condition: on-failure
      update_config:
        delay: 20s
        failure_action: rollback
        monitor: 30s
        order: start-first
    environment:
      CRONFIG: "0 23 * * *"
    image: xylphid/db-backup:1.5
    volumes:
      - //var/run/docker.sock:/var/run/docker.sock
      - backup-volume:/opt/backups/

Image inheritance

This docker image inherits from docker image.

Docker Pull Command

docker pull xylphid/backup