使用docker容器時(shí)如何轉(zhuǎn)換狀態(tài)-創(chuàng)新互聯(lián)

這篇文章給大家介紹使用docker容器時(shí)如何轉(zhuǎn)換狀態(tài),內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對(duì)大家能有所幫助。

成都創(chuàng)新互聯(lián)公司自2013年創(chuàng)立以來(lái),是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都做網(wǎng)站、成都網(wǎng)站建設(shè)、成都外貿(mào)網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元遵義做網(wǎng)站,已為上家服務(wù),為遵義各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:13518219792

一 docker容器狀態(tài)轉(zhuǎn)換圖

使用docker容器時(shí)如何轉(zhuǎn)換狀態(tài)

二 實(shí)戰(zhàn)

[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

本文標(biāo)題:使用docker容器時(shí)如何轉(zhuǎn)換狀態(tài)-創(chuàng)新互聯(lián)
鏈接URL:http://bm7419.com/article20/cdeeco.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號(hào)做網(wǎng)站、動(dòng)態(tài)網(wǎng)站建站公司、企業(yè)建站、自適應(yīng)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化