Skip to content

Instantly share code, notes, and snippets.

@liejuntao001
Last active May 20, 2021 20:17
Show Gist options
  • Save liejuntao001/cf8e621ad211f6c8b6f16eddd7480729 to your computer and use it in GitHub Desktop.
Save liejuntao001/cf8e621ad211f6c8b6f16eddd7480729 to your computer and use it in GitHub Desktop.
# https://www.guidodiepen.nl/2016/05/transfer-docker-data-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