docker system info

描述顯示系統級資訊
使用方式docker system info [OPTIONS]
別名
docker info

描述

此指令顯示有關 Docker 安裝的系統級資訊。顯示的資訊包括核心版本、容器和映像檔數量。所顯示的映像檔數量是唯一映像檔的數量。以不同名稱標記的同一個映像檔僅計算一次。

若指定了格式,則會執行該範本,而不是預設格式。Go 的 text/template 套件描述了格式的所有細節。

根據所使用的儲存驅動程式,可能會顯示額外資訊,例如儲存池名稱、資料檔、中繼資料檔、已使用的資料空間、總資料空間、已使用的中繼資料空間以及總中繼資料空間。

資料檔用於儲存映像檔,而中繼資料檔則用於儲存這些映像檔的相關中繼資料。當 Docker 首次執行時,會從掛載 /var/lib/docker 的磁碟區可用空間中分配一定數量的資料空間和中繼資料空間。

選項

選項預設值描述
-f, --format使用自訂模板格式化輸出
'json':以 JSON 格式列印
'TEMPLATE':使用指定的 Go 模板列印輸出。
關於使用模板格式化輸出的更多資訊,請參閱 https://docs.docker.com.tw/go/formatting/

範例

顯示輸出

下方的範例顯示了在 Ubuntu Linux 上執行的 daemon 的輸出,使用的是 overlay2 儲存驅動程式。如輸出所示,顯示了關於 overlay2 儲存驅動程式的額外資訊。

$ docker info

Client:
 Version:    25.0.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/local/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.1
    Path:     /usr/local/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 14
  Running: 3
  Paused: 1
  Stopped: 10
 Images: 52
 Server Version: 25.0.0
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 71909c1814c544ac47ab91d2e8b84718e517bb99
 runc version: v1.1.11-0-g4bccb38
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.11-linuxkit
 Operating System: Alpine Linux v3.19
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.663GiB
 Name: 4a7ed206a70d
 ID: c20f7230-59a2-4824-a2f4-fda71c982ee6
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

格式化輸出(--format)

您也可以指定輸出格式

$ docker info --format '{{json .}}'

{"ID":"4cee4408-10d2-4e17-891c-a41736ac4536","Containers":14, ...}

在 Windows 上執行 docker info

以下是在 Windows Server 上執行的 daemon 的範例輸出

C:\> docker info

Client: Docker Engine - Community
 Version:    24.0.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 17
 Server Version: 23.0.3
 Storage Driver: windowsfilter
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local splunk syslog
 Swarm: inactive
 Default Isolation: process
 Kernel Version: 10.0 20348 (20348.1.amd64fre.fe_release.210507-1500)
 Operating System: Microsoft Windows Server Version 21H2 (OS Build 20348.707)
 OSType: windows
 Architecture: x86_64
 CPUs: 8
 Total Memory: 3.999 GiB
 Name: WIN-V0V70C0LU5P
 ID: 2880d38d-464e-4d01-91bd-c76f33ba3981
 Docker Root Dir: C:\ProgramData\docker
 Debug Mode: false
 Experimental: true
 Insecure Registries:
  myregistry:5000
  127.0.0.0/8
 Registry Mirrors:
   http://192.168.1.2/
   http://registry-mirror.example.com:5000/
 Live Restore Enabled: false
© . This site is unofficial and not affiliated with Kubernetes or Docker Inc.