Created
August 23, 2017 19:27
-
-
Save enriquemanuel/fd79073cb05cd0f5d447bd2b46579312 to your computer and use it in GitHub Desktop.
Bash commands for removing all docker images/containers
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 | |
# Remove all containers | |
docker rm $(docker ps -aq) | |
# Remove all exited containers | |
docker rm $(docker ps -aqf status=exited) | |
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 | |
# Remove all images | |
docker rmi $(docker images -q) | |
# Remove all untagged images | |
docker rmi $(docker images -qf dangling=true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment