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 contain
docker container list -f "status=exited"
or
docker container ls -f "status=exited"
docker ps -f "status=exited"