Last active
September 7, 2022 07:24
-
-
Save rorens05/c8eb6edd2a0795e7b1ef706cd99bf15c to your computer and use it in GitHub Desktop.
Docker useful commands
This file contains hidden or 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
sudo docker-compose up | |
sudo docker-compose down | |
sudo docker-compose ps | |
sudo docker exec -it [container_id] bash | |
# Backup | |
sudo docker exec container_id sh -c 'exec mysqldump -uroot -ppassword app' > ./data.sql | |
# Restore | |
docker cp FILE_NAME.sql CONTAINER_ID:/FILE_NAME.sql | |
docker exec -it CONTAINER_ID bash | |
mysql -uroot -p app < FILE_NAME.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment