Skip to content

Instantly share code, notes, and snippets.

@KleaTech
Last active February 9, 2022 14:45
Show Gist options
  • Save KleaTech/bba7da880731a45f542700ed850e73a0 to your computer and use it in GitHub Desktop.
Save KleaTech/bba7da880731a45f542700ed850e73a0 to your computer and use it in GitHub Desktop.
Remove all docker images, containers on Windows (one liner)
From command line:
FOR /f "tokens=*" %i IN ('docker ps -aq') DO docker rm -f %i
FOR /f "tokens=*" %i IN ('docker images --format "{{.ID}}"') DO docker rmi -f %i
docker builder prune -a
From batch file:
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm -f %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi -f %%i
docker builder prune -a
source: https://gist.github.com/daredude/045910c5a715c02a3d06362830d045b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment