Last active
November 3, 2017 11:07
-
-
Save IngussNeilands/59e515cd689ae1c5179edcf3df7c1cab to your computer and use it in GitHub Desktop.
Docker: Remove all images and containers
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
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) | |
As of 1.13.0, see the new prune commands: | |
docker container prune # Remove all stopped containers | |
docker volume prune # Remove all unused volumes | |
docker image prune # Remove unused images | |
docker system prune # All of the above, in this order: containers, volumes, images | |
Bonus: | |
docker system df # Show docker disk usage, including space reclaimable by pruning | |
New Data Management commands PR: docker/docker#26108 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment