DEV Community

loading...

Docker stop/kill all

nombrekeff profile image Manolo Edge ・1 min read

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

Discussion

pic
Editor guide
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
Manolo Edge Author

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?