Last active
April 9, 2019 14:14
-
-
Save giubueno/90d72f7a34fa4e647cb34d1b8b5c5974 to your computer and use it in GitHub Desktop.
Docker commands
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
# Complete clean up | |
docker ps -a | grep -v CONTAINER | awk '{print $1}' | xargs docker stop | |
docker ps -a | grep -v CONTAINER | awk '{print $1}' | xargs docker rm | |
docker images | grep -v 'IMAGE ID' | awk '{print $3}' | xargs docker rmi | |
# Remove all stopped containers. | |
docker rm $(docker ps -a -q) | |
# Remove all untagged images | |
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") | |
# List the docker layers | |
docker history <image id> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment