Learn how to list all Docker containers, including running, stopped, and paused containers. List all Docker containers running on your machine. Includes step-by-step instructions and examples.
We can get a list of all containers in docker using docker container list
or docker ps
commands.
To list down docker containers we can use below two commands
docker container
ls command introduced in docker 1.13 version. In older versions we have to use docker ps
command.
The below command returns a list of all containers in docker.
docker container list -all
or
docker container ls -all
In older version of docker we can use docker ps
command to list all containers in docker.
$ docker ps -all
or
$ docker ps -a
The default docker container ls command shows all running docker containers.
$ docker container list
or
$ docker container ls
or
To get list of all running docker containers use the below command
$ docker ps
To get list of all stopped containers in docker use the below commands
$ docker container list -f "status=exited"
or
$ docker container ls -f "status=exited"
or you can use docker ps command
$ docker ps -f "status=exited"
To list out all latest created containers in docker use the below command.
$ docker container list --latest
To display n last created containers in docker use the below command.
$ docker container list --last=n
#docker #docker-container #docker-command