Docker Community Forums

Share and learn in the Docker community.

Docker processes not showing whalesay or hello-world images running

Hello!

I am new to docker and have just started playing around with it.
I follows the official docker documentation. As a part of it, I tried running the hello-world, whalesay and ubuntu images. After running these images, I could only see the ubuntu image under “docker ps” output but not the other two images. If that is also a container, why it is not showing up under processes?

ubuntu@ip-172-31-22-23:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker-whale latest aba3499fe5d3 6 minutes ago 275 MB
ubuntu latest f49eec89601e 7 days ago 129 MB
hello-world latest 48b5124b2768 2 weeks ago 1.84 kB
docker/whalesay latest 6b362a9f73eb 20 months ago 247 MB
ubuntu@ip-172-31-22-23:~$ docker run docker/whalesay
ubuntu@ip-172-31-22-23:~$ docker run docker/whalesay cowsay joo


< joo >

\
 \
  \
                ##        .
          ## ## ##       ==
       ## ## ## ##      ===
   /""""""""""""""""___/ ===

~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
______ o /
\ \ /
_
_
____/
ubuntu@ip-172-31-22-23:~$
ubuntu@ip-172-31-22-23:~$
ubuntu@ip-172-31-22-23:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0a5615a86d5d ubuntu “/bin/bash” 46 minutes ago Up 46 minutes wizardly_engelbart
ubuntu@ip-172-31-22-23:~$
ubuntu@ip-172-31-22-23:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
81edf223bea2 docker/whalesay “cowsay joo” 19 seconds ago Exited (0) 18 seconds ago hopeful_curran
5b4f46748efa docker/whalesay “/bin/bash” 31 seconds ago Exited (0) 30 seconds ago festive_jepsen
dd7fab97eeca docker-whale “/bin/sh -c '/usr/…” About a minute ago Exited (0) About a minute ago youthful_wozniak3
fcd49892ede5 docker-whale “/bin/sh -c '/usr/…” About a minute ago Exited (0) About a minute ago inspiring_shaw
06697073ed34 docker-whale “/bin/sh -c '/usr/…” About a minute ago Exited (0) About a minute ago pedantic_sinoussi
6535b47bb411 docker-whale “/bin/sh -c '/usr/…” About a minute ago Exited (0) About a minute ago suspicious_morse
668139bf36c1 docker-whale “/bin/sh -c '/usr/…” About a minute ago Exited (0) About a minute ago elastic_elion
960fa1e93c0d docker-whale “/bin/sh -c '/usr/…” 2 minutes ago Exited (0) 2 minutes ago friendly_babbage
aea65103e0db docker/whalesay “cowsay” 31 minutes ago Exited (0) 31 minutes ago wizardly_blackwell

docker ps -> is to check the currently running docker containers.

docker ps -a -> is to check all the containers (including stopped and running).

Hello-world container has no extra service running in inside, so after printing hello-world , it exits.

As soon as there is nothing to do (no service running) , the container will stop.

Thanks you James! I learnt a lot in docker now!