How to remove all stopped docker containers

Removing all docker containers that are currently stopped is simple:

docker-container-prune.sh
docker container prune

In case you want to skip the Are you sure you want to continue? [y/N] confirmation, use:

docker-container-prune-force.sh
docker container prune -f

Also see our post on How to remove all docker images that are not associated to a container.


Check out similar posts by category: Docker