Last active
January 19, 2018 00:36
-
-
Save AustinWinstanley/fadc1a79a71f1cee1205723f5e204fd2 to your computer and use it in GitHub Desktop.
Docker quick commands #Docker
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
| # | |
| # Docker | |
| # | |
| # List dangling volumes | |
| docker volume ls -f dangling=true | |
| # Purge dangling volumes | |
| docker volume rm $(docker volume ls -f dangling=true -q) | |
| # Remove all compose containers with their volumes and any orphans | |
| docker-compose down -v --remove-orphans | |
| # Delete all images | |
| docker rmi $(docker images -q) | |
| # | |
| # MariaDB | |
| # | |
| # Connect to MariaDB container | |
| docker exec -it test_mariadb bash # Replace 'test_mariadb' with container name | |
| # Dump MariaDB databases | |
| docker exec some-mariadb sh -c 'exec mysqldump --all-databases -uroot -p"$MYSQL_ROOT_PASSWORD"' > /some/path/on/your/host/all-databases.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment