Created
September 19, 2016 07:41
-
-
Save simahawk/7b8bd5efe72b39e548034b887b0d9fdd to your computer and use it in GitHub Desktop.
docker commands cheatsheet
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
# remove all images "months" old | |
docker images -a | grep 'months ago' | awk '{print $3}' | xargs --no-run-if-empty docker rmi | |
# remove all dangling images | |
docker rmi $(docker images -f "dangling=true" -q) | |
# remove all containers "months" old | |
docker ps -a | grep 'months ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm | |
# remove all containers exited | |
docker rm -v $(docker ps -a -q -f status=exited) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment