Created
June 28, 2018 18:54
-
-
Save michaelbunch/4fb62255e801f34040382d3b3bc8af25 to your computer and use it in GitHub Desktop.
Give Docker the deep clean it needs.
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 | |
echo "Flushing Docker... 🚽💦" | |
echo "Stopping container instances..." | |
docker stop $(docker ps -a -q) > /dev/null 2>&1 | |
echo "Removing container instances..." | |
docker rm $(docker ps -a -q) > /dev/null 2>&1 | |
echo "Removing cached images..." | |
docker rmi $(docker images -q) > /dev/null 2>&1 | |
echo "Pruning old networks..." | |
docker network prune -f > /dev/null 2>&1 | |
echo "Pruning old volumes..." | |
docker volume prune -f > /dev/null 2>&1 | |
echo "Done. 👍" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment