Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save darkxanter/249da77a22f9e0664f01283c3471911d to your computer and use it in GitHub Desktop.
Save darkxanter/249da77a22f9e0664f01283c3471911d to your computer and use it in GitHub Desktop.
migrate docker volume to another host
docker run --rm -v <SOURCE_DATA_VOLUME_NAME>:/from alpine ash -c "cd /from ; tar -cf - . " | ssh <TARGET_HOST> 'docker run --rm -i -v <TARGET_DATA_VOLUME_NAME>:/to alpine ash -c "cd /to ; tar -xpvf - " '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment