Skip to content

Instantly share code, notes, and snippets.

@aaronhelton
Last active December 20, 2016 14:12
Show Gist options
  • Save aaronhelton/6ba205a22c8e80eb4ad254dfba5ada42 to your computer and use it in GitHub Desktop.
Save aaronhelton/6ba205a22c8e80eb4ad254dfba5ada42 to your computer and use it in GitHub Desktop.
Windows PowerShell Docker Commands

Delete all of your collected docker images

Assumes your docker images list looks like:

<none> <none> 2b07576f6f81 ...

What you need from this list is 2b07576f6f81, which is the ID.

PS C:\> docker images | Select-String -Pattern '<none>' | foreach-object {docker rmi $_.tostring().split()[28]}

Comments welcome, especially if you know how to achieve a consistent split of docker images output that accounts for named images of varying length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment