Skip to content

Instantly share code, notes, and snippets.

@xardit
Created February 4, 2024 20:55
Show Gist options
  • Save xardit/d2d60c941cefb9ef91ce3809d2fa2c77 to your computer and use it in GitHub Desktop.
Save xardit/d2d60c941cefb9ef91ce3809d2fa2c77 to your computer and use it in GitHub Desktop.
Docker quick copy local folder (a mysql folder) to existing volume
#!/bin/bash
# test
docker run -it --rm -v wordpress-nginx-docker_mysql-data:/dest alpine
# delete
docker run --rm -v wordpress-nginx-docker_mysql-data:/dest -w /source alpine rm -rf /dest/*
# copy
docker run --rm -v $PWD:/source -v wordpress-nginx-docker_mysql-data:/dest -w /source alpine cp dbdata/* /dest/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment