Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does CREATED container mean in docker?

Tags:

docker

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 
like image 694
Here_2_learn Avatar asked May 02 '17 09:05

Here_2_learn


People also ask

What is created status in Docker container?

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. Docker container has been created using docker create command (this is done to speed up container creation).

How is a Docker container created?

The docker container create (or shorthand: docker create ) command creates a new container from the specified image, without starting it. When creating a container, the docker daemon creates a writeable container layer over the specified image and prepares it for running the specified command.

Do Docker images create containers?

Docker creates a new container, as though you had run a docker container create command manually. Docker allocates a read-write filesystem to the container, as its final layer. This allows a running container to create or modify files and directories in its local filesystem.

Why is Docker image created?

A Docker image is a read-only template that contains a set of instructions for creating a container that can run on the Docker platform. It provides a convenient way to package up applications and preconfigured server environments, which you can use for your own private use or share publicly with other Docker users.


1 Answers

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/

like image 195
kstromeiraos Avatar answered Sep 18 '22 08:09

kstromeiraos