我对docker容器的状态感到有点困惑,特别是状态为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
我的困惑在于docker将容器的状态显示为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
最佳答案
Docker状态已创建意味着已从映像创建容器,但它从未启动过.
原文链接:https://www.f2er.com/docker/437070.html这种状态可以通过这两种方式实现.
>使用docker create命令创建了Docker容器(这样做是为了加快容器创建).
> Docker容器已使用docker run创建,但无法成功启动.
有关更多信息,请查看docker create reference:https://docs.docker.com/engine/reference/commandline/create/