Last active
January 14, 2021 09:18
-
-
Save pubkey/73dcb894cf5f7d262863 to your computer and use it in GitHub Desktop.
Delete all Docker images and containers and 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
# stop and delete all containers | |
docker rm -f $(docker ps -a -q) | |
# delete all images | |
docker rmi -f $(docker images -q) | |
# delete all volumes | |
docker volume rm $(docker volume ls -q) | |
# remove all networks | |
docker network rm $(docker network ls -q) | |
## all together | |
docker rm -f $(docker ps -a -q) && docker rmi -f $(docker images -q) && docker volume rm $(docker volume ls -q) && docker network rm $(docker network ls -q) | |
# remove all docker-compose images (run this in the folder where your docker-compose.yml is) | |
docker-compose rm -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment