Public | Automated Build

Last pushed: 2 years ago
Short Description
Backup and restore docker containers volumes via rsync
Full Description

Ready to run Docker image to backup volumes

Docker image that allows you to backup volumes from your containers to a
specific path on host.

This image is generic, thus you can obviously re-use it within your
non-related EEA projects.

Supported tags and respective Dockerfile links

  • :latest (default)
  • :1.0

Base docker image

Source code


  1. Install Docker.


Note that /var/local/dockerbck is the path on host where you want this to
backup your docker data containers. Please modify it according with your needs.
As a best practice this should be on a different drive (external hard-disk, nfs, etc.)

This will create a folder at /var/local/dockerbck/volume-copy if it does not
exist and will store the volumes content in there.

Single run

$ docker run --rm \
  --volume=/:/rootfs:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --volume=/var/local/dockerbck:/backup:rw \

Run daily at 3:30 AM

$ docker run --rm \
  --volume=/:/rootfs:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --volume=/var/local/dockerbck:/backup:rw \
  -e "SCHEDULE=30 3 * * *" \ 

Run via docker-compose daily at 3:30 AM

Edit docker-compose.yml

  image: eeacms/volumesbackup
  - /:/rootfs:ro
  - /var/lib/docker:/var/lib/docker:ro
  - /etc/localtime:/etc/localtime:ro
  - /var/local/dockerbck:/backup:rw
  - SCHEDULE=30 3 * * *


$ docker-compose up -d
$ docker-compose logs


$ docker-compose pull

$ docker-compose stop
$ docker-compose rm -v
$ docker-compose up -d


If you are running this as a service make sure you also sync host time with
docker container time, otherwise the cron will run at 3:30 AM UTC time and not
your local time. See bellow how to fix this:

$ docker run --rm \

Supported environment variables

  • SCHEDULE Schedule backup at specific time with cron (e.g. SCHEDULE=30 3 * * *)
    Check wikipedia
    for more details about crontab format.

Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA).
All Rights Reserved.

The Original Code is free software;
you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later


European Environment Agency (EU)

Docker Pull Command
Source Repository