List only stopped Docker containers

Yogesh_D picture Yogesh_D · May 14, 2015 · Viewed 163.1k times · Source

Docker gives you a way of listing running containers or all containers including stopped ones.

This can be done by:

$ docker ps # To list running containers

Or by

$ docker ps -a # To list running and stopped containers

Do we have a way of only listing containers that have been stopped?

Answer

Yogesh_D picture Yogesh_D · May 14, 2015

Only stopped containers can be listed using:

docker ps --filter "status=exited"

or

docker ps -f "status=exited"