What does CREATED container mean in docker?

2019-04-18 17:06发布

问题:

I am bit confused on the status of the docker container, especially with status as CREATED.

I know that when the container is running state it shows as below:

root@labadmin-VirtualBox:~/RAGHU/DOCKER# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
1261afc2acc1        302fa07d8117        "/bin/bash"         43 minutes ago      Up 43 minutes                           optimistic_thompson

And if the container is stopped, it shows as below:

root@labadmin-VirtualBox:~/RAGHU/DOCKER# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
935f902efac7        302fa07d8117        "/bin/bash"              44 minutes ago      Exited (0) 44 minutes ago                       competent_golick
5eb1c2525e2e        302fa07d8117        "/bin/bash"              44 minutes ago      Exited (0) 44 minutes ago                       friendly_saha

My confusion is in what state does the docker shows the status of the container as CREATED:

root@labadmin-VirtualBox:~/RAGHU/DOCKER# docker ps -a | grep -i created
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
01c63f92586b        jenkins             "/bin/tini -- /usr..."   5 weeks ago         Created                                         gloomy_jones

回答1:

Docker status Created means that the container has been created from the image, but it has never been started.

This state can be achieved in this two ways.

  1. Docker container has been created using docker create command (this is done to speed up container creation).

  2. Docker container has been created using docker run but it hasn't been able to start successfully.

For further information check docker create reference: https://docs.docker.com/engine/reference/commandline/create/



标签: docker