Created
June 29, 2018 01:07
-
-
Save yowcow/6b1b3cc31d0a373d88a3614d8079dcfe to your computer and use it in GitHub Desktop.
List dangling docker images
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/sh | |
# List dangling images | |
docker images --filter dangling=true | |
# List dangling image IDs | |
docker images --filter dangling=true | awk 'NR > 1 { print $3 }' | |
# Remove all dangling images | |
docker images --filter dangling=true | awk 'NR > 1 { print $3 }' | xargs docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment