Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to list all the running docker containers by name?

Tags:

docker

I'm aware of how to get a list of "container ID's" of all running docker containers.

$ docker ps -q

like image 272
Vishwak Avatar asked Jul 21 '15 17:07

Vishwak


People also ask

How can I see all the running containers along with their container ID?

In Docker, we can use docker ps to show all running containers, docker ps -a to show all running and stopped containers. The ps stands for process status . On Docker, it shows the status of containers along with their IDs.

Which command is used to list all the container IDs?

To list Docker containers, use the docker container ls command or its alias docker ps .

What is the command to show stats for all running containers?

You can use the docker stats command to live stream a container's runtime metrics. The command supports CPU, memory usage, memory limit, and network IO metrics. The docker stats reference page has more details about the docker stats command.


1 Answers

This should do it. Apologies for the slash at the start.

$ docker inspect -f {{.Name}} $(docker ps -q)
/test
/test2
like image 122
Adrian Mouat Avatar answered Oct 22 '22 15:10

Adrian Mouat