I want to list the running containers in Docker. I have already learned how to build and run Docker containers but cannot work out how to list the containers. If you could show me how to list all Docker containers, list all the running Docker containers, and list the stopped Docker containers that would be great. Resolution:

The following tutorial demonstrates how to list running Docker containers via the Docker command line.

Docker magrkes it easy to run applications. The docker exec command runs a new command in a running container. After you have started a aDocker container, you can use the docker ps command to list the running doc containers. Docker also makes it possible to list every Docker container that has been started; you can also filter Docker to show the stopped conatiners only.

List All Docker Containers

You can list all of the Docker containers with the following commands:

$ docker ps -a

OR

$ docker ps --all

List Running Docker Containers

You can list the running Docker containers with the following command:

$ docker ps

List Stopped Docker Containers

You can list the stopped Docker containers with the following commands:

$ docker ps --filter "status=exited"

OR

$ docker ps -f "status=exited"

In conclusion, that is how to list running Docker containers. You can also use this tutorial to see all Docker containers and list the stopped Docker containers.

Related Tutorials