DEV Community

Discussion on: Docker Cheatsheet

Collapse
floryn90 profile image
Florin Lungu

It's wrong this command since it will remove all containers (running and stopped containers)!
docker ps -a -q will show you all containers into short syntax and docker rm will remove them!
The right syntax should be docker rm $(docker ps --filter status=exited -q) to remove all stopped containers

Collapse
cordigliere profile image
Cordigliere

No you have to use -f (force) to remove also running containers