Created
February 4, 2024 20:55
-
-
Save xardit/d2d60c941cefb9ef91ce3809d2fa2c77 to your computer and use it in GitHub Desktop.
Docker quick copy local folder (a mysql folder) to existing volume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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