容器created状态_docker容器状态的转换实现

一 docker容器状态转换图

a1035d350a1a237ed45407f93443b332.png

二 实战

[root@localhost ~]# docker info

Containers: 0

Running: 0

Paused: 0

Stopped: 0

Images: 3

Server Version: 17.09.0-ce

Storage Driver: overlay

Backing Filesystem: xfs

Supports d_type: false

Logging Driver: json-file

Cgroup Driver: cgroupfs

Plugins:

Volume: local

Network: bridge host macvlan null overlay

Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog

Swarm: inactive

Runtimes: runc

Default Runtime: runc

Init Binary: docker-init

containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0

runc version: 3f2f8b84a77f73d38244dd690525642a72156c64

init version: 949e6fa

Security Options:

seccomp

Profile: default

Kernel Version: 3.10.0-327.el7.x86_64

Operating System: CentOS Linux 7 (Core)

OSType: linux

Architecture: x86_64

CPUs: 1

Total Memory: 993MiB

Name: localhost.localdomain

ID: 6ULL:CFMN:YT7C:4RXZ:2CJ4:26H2:D4Y6:YHUP:SH7L:QLEQ:AWEB:EWTB

Docker Root Dir: /var/lib/docker

Debug Mode (client): false

Debug Mode (server): false

Registry: https://index.docker.io/v1/

Experimental: false

Insecure Registries:

127.0.0.0/8

Live Restore Enabled: false

WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.

Reformat the filesystem with ftype=1 to enable d_type support.

Running without d_type support will not be supported in future releases.

WARNING: bridge-nf-call-iptables is disabled

WARNING: bridge-nf-call-ip6tables is disabled

[root@localhost ~]# docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

clearlinux latest 32685d114002 6 days ago 62.5MB

busybox latest 6ad733544a63 6 days ago 1.13MB

alpine latest 053cde6e8953 6 days ago 3.96MB

[root@localhost ~]# docker run -d --name box1 busybox

4ca3d293206cd34e449075491679b0cddd619b451cac7a3d20d5b5daaa6095d8

[root@localhost ~]# docker run -itd --name box2 busybox

9c1578a50f0b97d48c7501dda6d6e1c3d8b3d9ed0e37416120f91f5a634fb12f

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

9c1578a50f0b busybox "sh" 13 seconds ago Up 11 seconds box2

4ca3d293206c busybox "sh" 47 seconds ago Exited (0) 45 seconds ago box1

[root@localhost ~]# docker run -itd --name box3 busybox

e84a746ea040603aa4db791da77aee2e2502ff5b184e89049a74805671a58ba9

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 5 seconds ago Up 4 seconds box3

9c1578a50f0b busybox "sh" About a minute ago Up About a minute box2

4ca3d293206c busybox "sh" 2 minutes ago Exited (0) 2 minutes ago

box1

[root@localhost ~]# docker info

Containers: 3

Running: 2

Paused: 0

Stopped: 1

Images: 3

Server Version: 17.09.0-ce

Storage Driver: overlay

Backing Filesystem: xfs

Supports d_type: false

Logging Driver: json-file

Cgroup Driver: cgroupfs

Plugins:

Volume: local

Network: bridge host macvlan null overlay

Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog

Swarm: inactive

Runtimes: runc

Default Runtime: runc

Init Binary: docker-init

containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0

runc version: 3f2f8b84a77f73d38244dd690525642a72156c64

init version: 949e6fa

Security Options:

seccomp

Profile: default

Kernel Version: 3.10.0-327.el7.x86_64

Operating System: CentOS Linux 7 (Core)

OSType: linux

Architecture: x86_64

CPUs: 1

Total Memory: 993MiB

Name: localhost.localdomain

ID: 6ULL:CFMN:YT7C:4RXZ:2CJ4:26H2:D4Y6:YHUP:SH7L:QLEQ:AWEB:EWTB

Docker Root Dir: /var/lib/docker

Debug Mode (client): false

Debug Mode (server): false

Registry: https://index.docker.io/v1/

Experimental: false

Insecure Registries:

127.0.0.0/8

Live Restore Enabled: false

WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.

Reformat the filesystem with ftype=1 to enable d_type support.

Running without d_type support will not be supported in future releases.

WARNING: bridge-nf-call-iptables is disabled

WARNING: bridge-nf-call-ip6tables is disabled

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 4 minutes ago Up 4 minutes box3

9c1578a50f0b busybox "sh" 6 minutes ago Up 6 minutes box2

4ca3d293206c busybox "sh" 6 minutes ago Exited (0) 6 minutes ago box1

[root@localhost ~]# docker restart 9c

9c

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 5 minutes ago Up 5 minutes box3

9c1578a50f0b busybox "sh" 7 minutes ago Up 2 seconds box2

4ca3d293206c busybox "sh" 8 minutes ago Exited (0) 8 minutes ago box1

[root@localhost ~]# docker pause 9c

9c

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 8 minutes ago Up 8 minutes box3

9c1578a50f0b busybox "sh" 10 minutes ago Up 2 minutes (Paused) box2

4ca3d293206c busybox "sh" 10 minutes ago Exited (0) 10 minutes ago box1

[root@localhost ~]# docker info

Containers: 3

Running: 1

Paused: 1

Stopped: 1

Images: 3

Server Version: 17.09.0-ce

Storage Driver: overlay

Backing Filesystem: xfs

Supports d_type: false

Logging Driver: json-file

Cgroup Driver: cgroupfs

Plugins:

Volume: local

Network: bridge host macvlan null overlay

Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog

Swarm: inactive

Runtimes: runc

Default Runtime: runc

Init Binary: docker-init

containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0

runc version: 3f2f8b84a77f73d38244dd690525642a72156c64

init version: 949e6fa

Security Options:

seccomp

Profile: default

Kernel Version: 3.10.0-327.el7.x86_64

Operating System: CentOS Linux 7 (Core)

OSType: linux

Architecture: x86_64

CPUs: 1

Total Memory: 993MiB

Name: localhost.localdomain

ID: 6ULL:CFMN:YT7C:4RXZ:2CJ4:26H2:D4Y6:YHUP:SH7L:QLEQ:AWEB:EWTB

Docker Root Dir: /var/lib/docker

Debug Mode (client): false

Debug Mode (server): false

Registry: https://index.docker.io/v1/

Experimental: false

Insecure Registries:

127.0.0.0/8

Live Restore Enabled: false

WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.

Reformat the filesystem with ftype=1 to enable d_type support.

Running without d_type support will not be supported in future releases.

WARNING: bridge-nf-call-iptables is disabled

WARNING: bridge-nf-call-ip6tables is disabled

[root@localhost ~]# docker unpause 9c

9c

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 11 minutes ago Up 11 minutes box3

9c1578a50f0b busybox "sh" 13 minutes ago Up 6 minutes box2

4ca3d293206c busybox "sh" 14 minutes ago Exited (0) 14 minutes ago box1

[root@localhost ~]# docker info

Containers: 3

Running: 2

Paused: 0

Stopped: 1

Images: 3

Server Version: 17.09.0-ce

Storage Driver: overlay

Backing Filesystem: xfs

Supports d_type: false

Logging Driver: json-file

Cgroup Driver: cgroupfs

Plugins:

Volume: local

Network: bridge host macvlan null overlay

Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog

Swarm: inactive

Runtimes: runc

Default Runtime: runc

Init Binary: docker-init

containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0

runc version: 3f2f8b84a77f73d38244dd690525642a72156c64

init version: 949e6fa

Security Options:

seccomp

Profile: default

Kernel Version: 3.10.0-327.el7.x86_64

Operating System: CentOS Linux 7 (Core)

OSType: linux

Architecture: x86_64

CPUs: 1

Total Memory: 993MiB

Name: localhost.localdomain

ID: 6ULL:CFMN:YT7C:4RXZ:2CJ4:26H2:D4Y6:YHUP:SH7L:QLEQ:AWEB:EWTB

Docker Root Dir: /var/lib/docker

Debug Mode (client): false

Debug Mode (server): false

Registry: https://index.docker.io/v1/

Experimental: false

Insecure Registries:

127.0.0.0/8

Live Restore Enabled: false

WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.

Reformat the filesystem with ftype=1 to enable d_type support.

Running without d_type support will not be supported in future releases.

WARNING: bridge-nf-call-iptables is disabled

WARNING: bridge-nf-call-ip6tables is disabled

[root@localhost ~]# docker kill 9c

9c

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 17 minutes ago Up 17 minutes box3

9c1578a50f0b busybox "sh" 19 minutes ago Exited (137) 3 seconds ago box2

4ca3d293206c busybox "sh" 20 minutes ago Exited (0) 20 minutes ago box1

[root@localhost ~]# docker stop e8

^[[Ae8

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 19 minutes ago Exited (137) 1 second ago box3

9c1578a50f0b busybox "sh" 21 minutes ago Exited (137) 2 minutes ago box2

4ca3d293206c busybox "sh" 22 minutes ago Exited (0) 22 minutes ago box1

[root@localhost ~]# docker start e8

e8

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 22 minutes ago Up 5 seconds box3

9c1578a50f0b busybox "sh" 24 minutes ago Exited (137) 4 minutes ago box2

4ca3d293206c busybox "sh" 24 minutes ago Exited (0) 24 minutes ago box1

[root@localhost ~]# docker start 9c

9c

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 25 minutes ago Up 3 minutes box3

9c1578a50f0b busybox "sh" 27 minutes ago Up 3 seconds box2

4ca3d293206c busybox "sh" 28 minutes ago Exited (0) 28 minutes ago box1

[root@localhost ~]# docker restart 9c

9c

[root@localhost ~]# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

e84a746ea040 busybox "sh" 26 minutes ago Up 4 minutes box3

9c1578a50f0b busybox "sh" 28 minutes ago Up 7 seconds box2

4ca3d293206c busybox "sh" 28 minutes ago Exited (0) 28 minutes ago box1

补充知识:一张图看懂docker容器的所有状态

02e6898d58f41e4159eb5de4a4c73bb6.png

部分解释:

创建容器的命令

run 是create和start的结合

create-created-start

例子:

docker create httpd

OCM硬件信息

docker kill id 强制关闭容器

die某个程序别强制退出,或者进程出错

docker pause :暂停容器中所有的进程。

docker unpause :恢复容器中所有的进程。

以上这篇docker容器状态的转换实现就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/396431.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ubuntu16.04配置sonarqube+MySQL

环境:rootubuntu:~# uname -a Linux ubuntu 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux rootubuntu:~# rootubuntu:~# cat /etc/issue Ubuntu 16.04 LTS \n \lrootubuntu:~#安装配置mysql:1、更新源…

鼠标固定在屏幕中间_无线电竞黑科技,雷柏VT950Q游戏鼠标评测

雷柏作为目前小有声誉的PC外设品牌,其定位高性能游戏领域的VT系列产品,想必大家也比较熟悉了。VT系列的产品除了有超强的性能以及出色的设计感,同时还都是性价比非常高的产品,即便是采用了旗舰级传感器,定位最为高端的…

WebSnapshotsHelper(HTML转换为图片)

1 /// <summary>2 /// WebBrowser Url生成图片3 /// HTML转图片4 /// </summary>5 public class WebSnapshotsHelper6 {7 Bitmap m_Bitmap;8 string m_Url;9 int m_BrowserWidth, m_BrowserHeight, m_ThumbnailWidth,…

synchronized 和 reentrantlock 区别是什么_JUC源码系列之ReentrantLock源码解析

目录ReentrantLock 简介ReentrantLock 使用示例ReentrantLock 与 synchronized 的区别ReentrantLock 实现原理ReentrantLock 源码解析ReentrantLock 简介ReentrantLock 是 JDK 提供的一个可重入的独占锁&#xff0c;独占锁&#xff1a;同一时间只有一个线程可以持有锁可重入&am…

mysql8.0递归_mysql8.0版本递归查询

1.先在mysql数据库添加数据DROP TABLE IF EXISTS dept;CREATE TABLE dept (id int(11) NOT NULL,pid int(11) DEFAULT NULL,name varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,date datetime(0) DEFAULT NULL,PRIMARY KEY (id) USING BTREE) ENGINE…

计算机中的字符编码

字符编码 什么是计算机编码 计算机只能处理二进制的数据&#xff0c;其它的数据都要进行转换&#xff0c;但转换必须要有一套字符编码(是字符与二进制的一个对应关系)。常用的字符&#xff1a;a-z、0-9、其它的符号等&#xff0c;计算机也不能直接处理。 &#xff08;字符编码类…

应急照明市电检测_应急照明如何供电? 如何接线? 图文分析!

对于大部分刚接触建筑电气设计的工作者来说&#xff0c;应急照明的强启原理一直都是很头疼的问题。由于不知道应急照明的强启原理&#xff0c;所以&#xff0c;应急灯具应该用多少根线&#xff0c;其实也就无从谈起。下面以文字和图片结合的方式来说明应急灯怎么接线的&#xf…

win10网速慢

升级到win10之后发现网速特别慢&#xff0c;搜了下&#xff0c;网上的解决办法果然好使&#xff0c;按照如下操作即可。 返回桌面&#xff0c;按WINR键组合&#xff0c;运行gpedit.msc 打开组策略 依次展开管理模板-》网络-》QoS数据计划程序-》限制可保留宽带&#xff0c;双击…

android实用代码

Android实用代码七段&#xff08;一&#xff09; 前言 这里积累了一些不常见确又很实用的代码&#xff0c;每收集7条更新一次&#xff0c;希望能对大家有用。 声明 欢迎转载&#xff0c;但请保留文章原始出处:)     博客园&#xff1a;http://www.cnblogs.com 农民伯伯&…

VS2015 Cordova Ionic移动开发(五)

一、创建侧边菜单和导航项目 1.使用VS创建一个Ionic空项目&#xff0c;同时创建一个Ionic SideMenu和Ionic Tabs项目。将SideMenu和Tabs项目里的templates和js文件合并到空项目里&#xff0c;修改js对应的代码即可。完整项目工程如下&#xff1a; 2.App.js代码修改如下&#xf…

阿里大数据神预测 胜率仅5.9%中国却1:0胜韩国

写在最前面&#xff1a;这是早晨偶然看到的一篇文章&#xff0c;是对昨天中国却1&#xff1a;0胜韩国的评论。有朋友感慨&#xff1a;努力不放弃的时候&#xff0c;全世界都会帮你。这篇内容很全面的串起阿里巴巴在大数据预测方面的动作&#xff0c;角度很别致&#xff0c;分享…

Python中类、对象与self详解

先介绍一下python中的类与对象/实例。然后详细说明self。说明&#xff1a;对象等同实例&#xff0c;本文称呼不一致时请自行统一 【一】类与对象/实例 1、类 &#xff08;1&#xff09;类由名称、属性、方法三部分组成 &#xff08;2&#xff09;类是抽象模板&#xff0c;比如学…

java开发环境:还在配classpath?你out啦!

2019独角兽企业重金招聘Python工程师标准>>> 先说结论&#xff1a;只需要配置JAVA_HOME和path路径即可&#xff0c;无需配置classpath 参考Oracle官网的说明&#xff1a; The class path tells JDK tools and applications where to find third-party and user-defi…

.Net Core 商城微服务项目系列(二):使用Ocelot + Consul构建具备服务注册和发现功能的网关...

1.服务注册 在上一篇的鉴权和登录服务中分别通过NuGet引用Consul这个包&#xff0c;同时新增AppBuilderExtensions类&#xff1a; public static class AppBuilderExtensions{public static IApplicationBuilder RegisterConsul(this IApplicationBuilder app,IApplicationLife…

四参数坐标转换c++_GPSRTK坐标转换及四参数、七参数适用条件

工程测量仪器已由经纬仪、全站仪过渡到GNSS(全球卫星导航系统)&#xff0c;特别是公路行业&#xff0c;GPS-RTK作为GNSS的一种应用目前已十分普及。现阶段GPS-RTK以WGS-84 坐标系统为主流&#xff0c;所发布的星历参数也是基于此坐标系统&#xff0c;但随着北斗导航系统的逐步完…

java hadoop api_Hadoop 系列HDFS的Java API( Java API介绍)

HDFS的Java APIJava API介绍将详细介绍HDFS Java API&#xff0c;一下节再演示更多应用。Java API 官网如上图所示&#xff0c;Java API页面分为了三部分&#xff0c;左上角是包(Packages)窗口&#xff0c;左下角是所有类(All Classes是)窗口&#xff0c;右侧是详情窗口。这里推…

最大连通子数组

这次是求联通子数组的求和&#xff0c;我们想用图的某些算法&#xff0c;比如迪杰斯特拉等&#xff0c;但是遇到了困难。用BFS搜索能达到要求&#xff0c;但是还未能成功。 那么我们这样想&#xff0c;先将每行的最大子数组之和&#xff0c;然后再将这些最大之和组成一个数组&a…

[Matlab] 画图命令

matlab画图命令&#xff0c;不定时更新以便查找 set(gcf, color, [1 1 1]);     % 使图背景为白色 alpha(0.4);           %设置平面透明度 plot(Circle1,Circle2,k--,linewidth,1.25);  % k--设置线型  ‘linewidth’,1.25  设置线宽度为1.25 %线型   …

终端terminal的颜色配置

PS1 color 终端terminal的颜色配置 PS1"\[\e[92;1m\][\u\e[90;5m\e[25m\[\e[91;4m\]Atlas\e[24m\[\e[1m\]\[\e[92;1m\] \W ]\\$\[\e[0m\]" Set CodeDescriptionExamplePreview1Bold/Bright echo -e "Normal \e[1mBold" 2Dim echo -e "Normal \e[2mDi…

Linux Kernel Oops异常分析

0&#xff0e;linux内核异常常用分析方法 异常地址是否在0附近&#xff0c;确认是否是空指针解引用问题异常地址是否在iomem映射区&#xff0c;确认是否是设备访问总线异常问题&#xff0c;如PCI异常导致的地址访问异常异常地址是否在stack附近&#xff0c;如果相邻&#xff0c…