容器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.pswp.cn/news/396431.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/396431.shtml
英文地址,請注明出處:http://en.pswp.cn/news/396431.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

nodejs命令行執行程序_在NodeJS中編寫命令行應用程序

nodejs命令行執行程序by Peter Benjamin彼得本杰明(Peter Benjamin) 在NodeJS中編寫命令行應用程序 (Writing Command-Line Applications in NodeJS) With the right packages, writing command-line apps in NodeJS is a breeze.有了合適的軟件包,用NodeJS編寫命令…

python re findall 效率_python re模塊findall()詳解

今天寫代碼,在寫到鄭澤的時候遇到了一個坑,這個坑是re模塊下的findall()函數。下面我將結合代碼,記錄一下importrestring"abcdefg acbdgef abcdgfe cadbgfe"#帶括號與不帶括號的區別#不帶括號regexre.compile("((\w)\s\w)&quo…

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、更新源…

mysql 多表混全_mysql--淺談多表查詢1

這是對自己學習燕十八老師mysql教程的總結,非常感謝燕十八老師。依賴軟件:mysql5.6系統環境:win連接查詢在談連接查詢之前我們需要對數學上的笛卡爾積有一定的了解現在有兩個集合m和nm (m1,m2,.....mx)n (n1,n2,.....ny)m*n得到的笛卡爾積有…

鼠標固定在屏幕中間_無線電競黑科技,雷柏VT950Q游戲鼠標評測

雷柏作為目前小有聲譽的PC外設品牌,其定位高性能游戲領域的VT系列產品,想必大家也比較熟悉了。VT系列的產品除了有超強的性能以及出色的設計感,同時還都是性價比非常高的產品,即便是采用了旗艦級傳感器,定位最為高端的…

談論源碼_5,000名開發人員談論他們的薪水

談論源碼Let’s dive into the most interesting results from the O’Reilly 2016 Salary Survey of 5,000 developers (which excluded managers and students).讓我們來看看OReilly 2016年薪金調查對5,000名開發人員(其中不包括經理和學生)最有趣的結果。 性別工資差距是真…

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,…

兩個多項式相乘求解系數數組算法

題目描述&#xff1a; 給出兩個多項式&#xff0c;最高次冪分別為n和m&#xff0c;求解這兩個系數相乘得到的系數數組。 分析&#xff1a; 最高次冪如果是m和n&#xff0c;那么他們相乘得到的系數數組的最高次冪一定是nm&#xff0c;對于其他的系數&#xff0c;不妨設a[],b[]是…

synchronized 和 reentrantlock 區別是什么_JUC源碼系列之ReentrantLock源碼解析

目錄ReentrantLock 簡介ReentrantLock 使用示例ReentrantLock 與 synchronized 的區別ReentrantLock 實現原理ReentrantLock 源碼解析ReentrantLock 簡介ReentrantLock 是 JDK 提供的一個可重入的獨占鎖&#xff0c;獨占鎖&#xff1a;同一時間只有一個線程可以持有鎖可重入&am…

gulp 和npm_為什么我離開Gulp和Grunt去看npm腳本

gulp 和npmI know what you’re thinking. WAT?! Didn’t Gulp just kill Grunt? Why can’t we just be content for a few minutes here in JavaScript land? I hear ya, but…我知道你在想什么 WAT &#xff1f;&#xff01; 古爾普不是殺死了咕unt嗎&#xff1f; 為什么…

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…

js 輪播插件

flexslider pc插件 個人用過flickerplate 移動端插件 個人用過個人覺得比較好的移動端插件swiper http://www.swiper.com.cn/ 用過個人覺得比較好的pc端插件待定

計算機中的字符編碼

字符編碼 什么是計算機編碼 計算機只能處理二進制的數據&#xff0c;其它的數據都要進行轉換&#xff0c;但轉換必須要有一套字符編碼(是字符與二進制的一個對應關系)。常用的字符&#xff1a;a-z、0-9、其它的符號等&#xff0c;計算機也不能直接處理。 &#xff08;字符編碼類…

致力微商_致力于自己。 致力于公益組織。

致力微商by freeCodeCamp通過freeCodeCamp 致力于自己。 致力于公益組織。 (Commit to Yourself. Commit to a Nonprofit.) In case you missed it, our October Summit was jam-packed with several big announcements about our open source community.如果您錯過了它&#…

應急照明市電檢測_應急照明如何供電? 如何接線? 圖文分析!

對于大部分剛接觸建筑電氣設計的工作者來說&#xff0c;應急照明的強啟原理一直都是很頭疼的問題。由于不知道應急照明的強啟原理&#xff0c;所以&#xff0c;應急燈具應該用多少根線&#xff0c;其實也就無從談起。下面以文字和圖片結合的方式來說明應急燈怎么接線的&#xf…

win10網速慢

升級到win10之后發現網速特別慢&#xff0c;搜了下&#xff0c;網上的解決辦法果然好使&#xff0c;按照如下操作即可。 返回桌面&#xff0c;按WINR鍵組合&#xff0c;運行gpedit.msc 打開組策略 依次展開管理模板-》網絡-》QoS數據計劃程序-》限制可保留寬帶&#xff0c;雙擊…

ubuntu安裝nodejs

下載nodejs https://nodejs.org/dist/v4.6.0/node-v4.6.0-linux-x64.tar.gz 解壓 tar -zxvf node-v4.6.0-linux-x64.tar.gz 移動到/opt/下 mv node-v4.6.0-linux-x64 /opt/ 創建鏈接 ln -s /opt/node-v4.6.0-linux-x64/bin/node /usr/local/bin/node 轉載于:https://www.cnblog…

android實用代碼

Android實用代碼七段&#xff08;一&#xff09; 前言 這里積累了一些不常見確又很實用的代碼&#xff0c;每收集7條更新一次&#xff0c;希望能對大家有用。 聲明 歡迎轉載&#xff0c;但請保留文章原始出處:)     博客園&#xff1a;http://www.cnblogs.com 農民伯伯&…

mysql 全文本檢索的列_排序數據列以檢索MySQL中的最大文本值

為此&#xff0c;您可以將ORDER BY與一些聚合函數right()一起使用。讓我們首先創建一個表-create table DemoTable1487-> (-> StudentCode text-> );使用插入命令在表中插入一些記錄-insert into DemoTable1487 values(560);insert into DemoTable1487 values(789);in…

關于長壽_FreeCodeCamp可以幫助您更長壽

關于長壽by Christopher Phillips克里斯托弗菲利普斯(Christopher Phillips) 免費代碼營可能幫助您長壽 (Free Code Camp Might Help You Live Longer) Since I started my web development journey with Free Code Camp, I’ve felt more awake, more alert, and able to pro…