There exist many scripts that create a backup of your docker volumes to for example your local machine. One example can be found at
and another one at
The main difference between the two approaches is that the first project runs the backup script from within the container and the second spawns a container from within the script. The main benefits of the second approach are:
- No need to build a custom image containing the script as entrypoint
- The script controls the conditions under which the container is supposed to run
A revised version of the second project can be found in the forked github repository
With the forked version, it is possible to create back-ups using docker-machine from a remote server to your local machine.