Skip to content

Instantly share code, notes, and snippets.

@ajardin
Last active April 17, 2018 15:50
Show Gist options
  • Save ajardin/1ae66d888c7cc6bfe95ded2058a9e7ac to your computer and use it in GitHub Desktop.
Save ajardin/1ae66d888c7cc6bfe95ded2058a9e7ac to your computer and use it in GitHub Desktop.
Use MySQL data directly from a Docker volume.
# Extract MySQL data
docker run --rm --volumes-from XXXXX -v $(pwd):/backup busybox sh -c "tar cvf /backup/backup.tar /var/lib/mysql"
# Restore MySQL data
docker run --rm --volumes-from XXXXX -v $(pwd):/backup busybox sh -c "tar xvf /backup/backup.tar var/lib/mysql/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment