Created
January 28, 2021 03:42
-
-
Save joelhoelting/2ccb4e99089dc8a561014bbf568aebd2 to your computer and use it in GitHub Desktop.
Cleanup all docker images, containers, volumes and networks
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 | |
# Stop all containers | |
docker stop $(docker ps -aq) | |
# Remove all images (forced) | |
docker rmi $(docker images -q) -f | |
# Remove all containers | |
docker rm $(docker ps -aq) | |
# Prune volumes | |
echo y | docker volume prune | |
# Prune networks | |
echo y | docker network prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment