Created
April 27, 2018 15:32
-
-
Save daBONDi/c92a15a87c219eaf5824b6312f9d516e to your computer and use it in GitHub Desktop.
Cleanup Docker Images Powershell
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
# Epic Akward Powershell Cleanup for Docker images | |
# Get Docker Images with <None> in Line and return the a List of Image Ids | |
docker images --no-trunc | ?{ $_ -match "<none>" } | % { ($_ -split '\s+|\t+')[2]} | %{ ($_ -split ':')[1]} | |
# Do the Same with Cleanup | |
docker rmi $(docker images --no-trunc | ?{ $_ -match "<none>" } | % { ($_ -split '\s+|\t+')[2]} | %{ ($_ -split ':')[1]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment