Skip to content

Instantly share code, notes, and snippets.

@droxer
Created June 10, 2015 01:07
Show Gist options
  • Save droxer/20b744c1a1ddba0969b7 to your computer and use it in GitHub Desktop.
Save droxer/20b744c1a1ddba0969b7 to your computer and use it in GitHub Desktop.
Docker data only container backup/restore
# backup
docker run --volumes-from mongodata -v $(pwd):/backup busybox tar cvf /backup/backup.tar /data/db
# restore
docker run --volumes-from mongodata -v $(pwd):/backup busybox tar xvf /backup/backup.tar
# Dockerfile
FROM centos
VOLUME /data/db
CMD ["true"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment