Public | Automated Build

Last pushed: 2 years ago
Short Description
Docker image to backup/restore your Docker data
Full Description

youdarnet/dockup for Qiniu(七牛)

Docker image to backup your Docker container volumes

Why the name? Docker + Backup = Dockup

Usage

You have a container running with one or more volumes:

$ docker run -d --name mysql tutum/mysql

From executing a $ docker inspect mysql we see that this container has two volumes:

"Volumes": {
            "/etc/mysql": {},
            "/var/lib/mysql": {}
        }

Backup

ENV:

Q_BUCKET_NAME=<qiniu_bucket>
Q_ACCESS_KEY=<key_here>
Q_SECRET_KEY=<secret_here>
#Q_UP_POINT=up.qiniug.com
APP_NAME=<optional_app_name>
  • Note, APP_NAME will be add to the backup filename.

Launch dockup container with the following flags:

$ docker run --rm \
--env-file env.txt \
--volumes-from mysql \
--name dockup youdarnet/dockup:latest

The contents of env.txt being:

Q_BUCKET_NAME=qiniu_bucket
Q_ACCESS_KEY=<key_here>
Q_SECRET_KEY=<secret_here>
BACKUP_NAME=mysql
PATHS_TO_BACKUP=/etc/mysql /var/lib/mysql
RESTORE=false

dockup will use your Qiniu(七牛) credentials to create a new bucket with name as per the environment variable Q_BUCKET_NAME, or if not defined, using the default name qiniu_bucket. The paths in PATHS_TO_BACKUP will be tarballed, gzipped, time-stamped and uploaded to the Qiniu bucket.

Restore

To restore your data simply set the RESTORE environment variable to true - this will restore the latest backup from S3 to your volume.

A note on Buckets

For more info, refer to

Docker Pull Command
Owner
youdarnet
Source Repository