Docker image to backup your Docker container volumes
Why the name? Docker + Backup = Dockup
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": {}
}
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>
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.
To restore your data simply set the RESTORE environment variable to true - this will restore the latest backup from S3 to your volume.
For more info, refer to
Content type
Image
Digest
Size
159.9 MB
Last updated
about 10 years ago
docker pull rankun203/dockup