Created
December 20, 2020 06:44
-
-
Save vijaysharmay/a6fdef60254da5acde7d0e191f5567df to your computer and use it in GitHub Desktop.
BAT file for stopping & removing all containers on Windows
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
| @ECHO OFF | |
| FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker stop %%i | |
| FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also use the below command to remove all dangling images:
FOR /f "tokens=*" %%i IN ('docker images -f "dangling=true" -q') DO docker rmi %%i