DEV Community

Keff
Keff

Posted on

5

Docker stop/kill all

Some commands I end up searching all the time:

docker stop $(docker ps -a -q) # stop all containers
docker rm $(docker ps -a -q)   # remove all containers
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
fernando93d profile image
Fernando García Pérez

You also can use docker container prune to remove all stopped containers

Collapse
 
nombrekeff profile image
Keff

Ohh cool, didn't know about that command, just the system prune one, good to know :)

Do you know if adding --all removes running ones too?

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more