This is an article where it has a direct connection with another docker article in this site. There is a previous article before with the title of ‘How to list all docker container’ in this link. It shows how to list all available docker containers in the operating system. No matter the container is currently running or it has already stop.
The sample case in this article is in an Ubuntu Linux operating system. In order to deal on how to list docker container, there is a specific command to do it. Furthermore, the execution of the command need a command line interface.
Testing the Docker Command Execution
In order to list docker container available in the operating system, there is a certain specific requirement. Make sure that the ‘docker’ tool is available in the operating system. In order to check whether it is available or not, just type ‘docker’ in the command line interface :
If there is no ‘docker’ tool available in the operating system, try to install it first. Read the article with the title of ‘How to Install Docker in Linux Ubuntu 18.04 Bionic Beaver’ in this link to get information on how to install it in Ubuntu Linux 18.04 Bionic Beaver just as an additional reference.
Listing the Running Docker Container
Finally, in order to list the running docker container, just type the following command :
By default, executing the above command in the operating system’s command line will only present all running docker containers. If there aren’t any docker containers running, the following output will appear :
root@hostname:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES root@hostname:~#
For more information, read another article with the title of ‘How to list all docker container’ in this link. It is very useful to get the information on how to display all of available docker containers whether it is currently running or stop.