FreeKB - Docker docker container ls command (list containers)
Docker - docker container ls command (list containers)

This assumes you have installed Docker on Linux and Docker is running. The docker container ls command will return the list of containers.

docker container ls

 

Which will return something like this. If the container was created but not yet started, the status of the container will be "created".

CONTAINER ID     IMAGE              COMMAND                 CREATED         STATUS     PORTS     NAMES
d937372c09ab9    b939aa938add9913   "/docker-entrypoin..."  6 minutes ago   Created              my-container

 

After using the docker start command to start the container, the status of the container should either be "up xxx" or "exited". If the container is up, the socket (ip address:port) being used by the container will be displayed. If the status is "exited", use the docker logs command to determine why the container failed to start.

CONTAINER ID     IMAGE              COMMAND                 CREATED       STATUS        PORTS     NAMES
d937372c09ab9    b939aa938add9913   "/docker-entrypoin..."  6 minutes ago Up 30 seconds 0.0.0.0:12345->12345/tcp

 

If the status of the container is "Exited (1)", attempt to start the container using the docker start command. If the container still has a status of Exited, check the docker logs.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter e7a37 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |