Skip to content

Instantly share code, notes, and snippets.

@daBONDi
Created April 27, 2018 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daBONDi/c92a15a87c219eaf5824b6312f9d516e to your computer and use it in GitHub Desktop.
Save daBONDi/c92a15a87c219eaf5824b6312f9d516e to your computer and use it in GitHub Desktop.
Cleanup Docker Images Powershell
# 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