Skip to content

Instantly share code, notes, and snippets.

@arthurpham
Last active August 28, 2018 14:52
Show Gist options
  • Save arthurpham/a517d60001171a9a5e8cb83c8415b6d9 to your computer and use it in GitHub Desktop.
Save arthurpham/a517d60001171a9a5e8cb83c8415b6d9 to your computer and use it in GitHub Desktop.
How to remove unused Docker containers and images on windows
  1. Delete all images

FOR /f "tokens=*" %i IN ('docker images -q -f "dangling=true"') DO docker rmi %i

  1. Delete all containers

FOR /f "tokens=*" %i IN ('docker ps -aq') DO docker rm %i

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