Skip to content

Instantly share code, notes, and snippets.

@FrankFang
Last active June 27, 2023 11:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrankFang/86657d8e9d6cb4872b71255f0a3c8999 to your computer and use it in GitHub Desktop.
Save FrankFang/86657d8e9d6cb4872b71255f0a3c8999 to your computer and use it in GitHub Desktop.
# https://www.docker.com/blog/back-up-and-share-docker-volumes-with-this-extension/
# run in host
mkdir repos
mkdir config
docker run -it -v repos:/repos -v config:/config -v "$(pwd)/repos":/outside_repos -v "$(pwd)/config":/outside_config busybox sh
# run in container
cd /repos
find . -name node_modules -type d -exec rm -rf {} \;
find . -name dist -type d -exec rm -rf {} \;
find . -name tmp -type d -exec rm -rf {} \;
find . -name cache -type d -exec rm -rf {} \;
du -sh
cp -r * /outside_repos
cd /config
cp -r * /outside_config
cp -r .??* /outside_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment