Stop/Remove All Docker containers

Stop / remove all Docker containers

Hints to use with docker.

In the version 1.13.x and higher :

Remove all unused containers, volumes, networks and images (both dangling and unreferenced).

docker system prune

Link : doc docker

Removes all stopped containers.

docker container prune

Link : doc docker

Hack and hints

There are many ways to stop/remove all Docker containers.

 On Unix/Linux :

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)


docker rm -f $(docker ps -a -q)

For All images :

docker rmi $(docker images -q)

Remove all containers and volumes :

docker rm -v $(docker ps -a -q)

Stop faster docker images :

docker ps -a -q | xargs -n 1 -P 8 -I {} docker stop {}


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


docker rm @(docker ps -aq)

Link :

Please follow and like us:

Sylvain Leroy

Digital Solution Architect in Switzerland, I have previously created my own company, Tocea, in Software Quality Assurance. Currently living in Lausanne (CH)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *