Hi all
I’m running several docker containers with local persistent volumes that I would like to backup. I haven’t found an easy method to do so.
What do you use / recommend to do that? AFAIK you can’t just rsync the volume directory while the container is running.
Bind mounts are easy to maintain and backup. However if you share data amongst multiple container docker volumes are recommend especially for managing state.
Backup volumes:
docker run --rm --volumes-from dbstore -v $(pwd):/backup containername tar cvf /backup/backup.tar /dbdata
docker docs - volumes
Database volume backup without stopping the service: bash into the container, dump it, and copy it out with docker cp. Run it periodically via crontab