1. 程式人生 > >docker容器狀態的轉換

docker容器狀態的轉換

[[email protected] ~]# 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
[
[email protected]
~]# 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 [
[email protected]
~]# docker run -d --name box1 busybox 4ca3d293206cd34e449075491679b0cddd619b451cac7a3d20d5b5daaa6095d8 [[email protected] ~]# docker run -itd --name box2 busybox 9c1578a50f0b97d48c7501dda6d6e1c3d8b3d9ed0e37416120f91f5a634fb12f [[email protected] ~]# 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 [
[email protected]
~]# docker run -itd --name box3 busybox e84a746ea040603aa4db791da77aee2e2502ff5b184e89049a74805671a58ba9 [[email protected] ~]# 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 [[email protected] ~]# 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 [[email protected] ~]# 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 [[email protected] ~]# docker restart 9c 9c [[email protected] ~]# 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 [[email protected] ~]# docker pause 9c 9c [[email protected] ~]# 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 [[email protected] ~]# 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 [[email protected] ~]# docker unpause 9c 9c [[email protected] ~]# 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 [[email protected] ~]# 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 [[email protected] ~]# docker kill 9c 9c [[email protected] ~]# 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 [[email protected] ~]# docker stop e8 ^[[Ae8 [[email protected] ~]# 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 [[email protected] ~]# docker start e8 e8 [[email protected] ~]# 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 [[email protected] ~]# docker start 9c 9c [[email protected] ~]# 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 [[email protected] ~]# docker restart 9c 9c [[email protected] ~]# 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容器狀態轉換

[[email protected] ~]# docker info Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 3 Server Version: 17.09.0-ce Storage Driver: overlay Backing

docker 容器狀態檢視

檢視 docker 容器的狀態資訊 檢視容器狀態: docker stats nginx1 檢視程序資訊: docker top nginx1   inspect 使用 docker inspect 來檢視Docker的底層資訊。它會返回一個 JSON 檔案記錄著 Dock

docker容器無法刪除——狀態Dead

無法 info ima doc src 圖片 dead 分享 進行 問題:由於容器掛載數據卷,無法直接刪除。 解決: 先查出ID 進行殺掉,然後再刪除。 、 搞定docker容器無法刪除——狀態Dead

監控docker容器內mysql主從同步狀態

使用 bin con -i ner 獲取 face ont stdin Docker exec 命令docker exec :在運行的容器中執行命令語法docker exec [OPTIONS] CONTAINER COMMAND [ARG...]OPTIONS說明:-d

zabbix自發現實時監控docker容器容器中各個服務的狀態線上業務展示

本文從開始到監控docker容器狀態分為三部分1.檢視自己的環境變數以及自己的服務路徑(1)jdk環境: jdk1.8(2)zabbix版本:zabbix3.4.5(3)zabbix指令碼存放路徑:/data/zabbix/scripts/( 4 ) .conf檔案存放路徑:/data/zabbix/etc/

docker 啟動容器方式 檢視容器狀態

容器兩種方式進行啟動 一種是基於建立一個容器並啟動 docker create docker start 另一種 使用 run 建立自動啟動;是狀態下的停止 啟動 docker start nginx1 # service docker start # docker run -

rexray docker ceph-rbd 實現無狀態資料庫docker容器實戰

1.前提條件 1.1有了一個可用的ceph 叢集 其中mon1節點的IP 10.20.4.1 1.2 有2臺虛擬機器可以用於驗證測試,虛擬機器能上網,DNS設定正常。 關於如何建立ceph叢集,請參考文章:https://blog.csdn.net/happyfreeangel/arti

Java中的線程狀態轉換和線程控制常用方法

img sta () throw line star height style 技術 Java 中的線程狀態轉換:    【註】:不是 start 之後就立刻開始執行, 只是就緒了(CPU 可能正在運行其他的線程). 【註】:只有被 CPU 調度之後,線程才開始執行, 當

調試 Dockerfile - 每天5分鐘玩轉 Docker 容器技術(15)

top add font tom middle 程序 ria family 是個 包括 Dockerfile 在內的任何腳本和程序都會出錯。有錯並不可怕,但必須有辦法排查,所以本節討論如何 debug Dockerfile。 先回顧一下通過 Dockerfile 構建鏡像

Dockerfile 常用指令 - 每天5分鐘玩轉 Docker 容器技術(16)

依次 官方文檔 構建 bottom str -s 暴露 工作 12px 是時候系統學習 Dockerfile 了。下面列出了 Dockerfile 中最常用的指令,完整列表和說明可參看官方文檔。 FROM指定 base 鏡像。 MAINTAINER設置鏡像的作

RUN vs CMD vs ENTRYPOINT - 每天5分鐘玩轉 Docker 容器技術(17)

docker 教程 容器 RUN、CMD 和 ENTRYPOINT 這三個 Dockerfile 指令看上去很類似很容易混淆。本節將通過實踐詳細討論它們的區別。簡單的說RUN 執行命令並創建新的鏡像層RUN 經常用於安裝軟件包。CMD 設置容器啟動後默認執行的命令及其參數但 CMD 能夠被 doc

使用公共 Registry - 每天5分鐘玩轉 Docker 容器技術(19)

docker 教程 容器 保存和分發鏡像的最直接方法就是使用 Docker Hub。Docker Hub 是 Docker 公司維護的公共 Registry。用戶可以將自己的鏡像保存到 Docker Hub 免費的 repository 中。如果不希望別人訪問自己的鏡像,也可以購買私有 repos

Docker 鏡像小結 - 每天5分鐘玩轉 Docker 容器技術(21)

列表 例如 normal one sys tro docker comm color 本節我們對 Docker 鏡像做個小結。 這一部分我們首先討論了鏡像的分層結構,然後學習了如何構建鏡像,最後實踐使用 Docker Hub 和本地 registry。 下面是鏡像的常用操作

如何運行容器?- 每天5分鐘玩轉 Docker 容器技術(22)

docker 教程 容器 上一章我們學習了如何構建 Docker 鏡像,並通過鏡像運行容器。本章將深入討論容器:學習容器的各種操作,容器各種狀態之間如何轉換,以及實現容器的底層技術。運行容器docker run 是啟動容器的方法。在討論 Dockerfile 時我們已經學習到,可用三種方式指定容器

兩種進入容器的方法 - 每天5分鐘玩轉 Docker 容器技術(23)

工作 技術 啟動進程 gin attach ant while col -c 我們經常需要進到容器裏去做一些工作,比如查看日誌、調試、啟動其他進程等。有兩種方法進入容器:attach 和 exec。 docker attach 通過 docker attach 可以 a

Docker基本命令與使用 —— Docker容器(一)

使用 -a 基本 com sta start 日誌 靜態頁面 don 一.容器的基本操作 1. 啟動容器 docker run IMAGE [COMMAND] [ARG...] run 在新容器中執行命令 eg: docker run ubuntu echo ‘He

線程的幾種狀態轉換<轉>

dead 4.4 所有 mon 結合 函數 語言 進行 指定時間 線程在一定條件下,狀態會發生變化。線程一共有以下幾種狀態: 1、新建狀態(New):新創建了一個線程對象。 2、就緒狀態(Runnable):線程對象創建後,其他線程調用了該對象的start()方法。該狀

運行容器的最佳實踐 - 每天5分鐘玩轉 Docker 容器技術(24)

oat add vertical poi can size 執行命令 後臺 運行 按用途容器大致可分為兩類:服務類容器和工具類的容器。 1. 服務類容器以 daemon 的形式運行,對外提供服務。比如 web server,數據庫等。通過 -d 以後臺方式啟動這類容器是非常

容器常用操作 - 每天5分鐘玩轉 Docker 容器技術(25)

技術 order position 自動 code lec 資源 add 服務 前面討論了如何運行容器,本節學習容器的其他常用操作。 stop/start/restart 容器 通過 docker stop 可以停止運行的容器。 容器在 docker host 中實際上是

限制容器對內存的使用 - 每天5分鐘玩轉 Docker 容器技術(27)

upload 機制 性能 http tle war pac 啟動 物理內存 一個 docker host 上會運行若幹容器,每個容器都需要 CPU、內存和 IO 資源。對於 KVM,VMware 等虛擬化技術,用戶可以控制分配多少 CPU、內存資源給每個虛擬機。對於容器,D