本文介绍了在Docker中,CREATED容器是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对docker容器的状态感到困惑,尤其是对于状态为已创建的情况。

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

我知道容器运行时状态如下所示:

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

如果容器已停止,则显示如下:

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

我的困惑是码头工人将容器的状态显示为已创建

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


推荐答案

Docker状态已创建表示该容器具有是从映像创建的,但从未启动过。

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容器是使用 docker create 命令创建的(这样做是为了加快容器的创建速度。)

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

已使用 docker run 创建了Docker容器,但未能成功启动。

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

有关更多信息,请参见 docker create 参考:

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

这篇关于在Docker中,CREATED容器是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 22:18