描述
docker info : 显示 Docker 系统信息,包括镜像和容器数。
用法
docker info [OPTIONS]
选项
--format , -f:格式化输出参数
实例
$ docker info Client: Debug Mode: falseServer: Containers: 14 Running: 3 Paused: 1 Stopped: 10 Images: 52 Server Version: 1.10.3 Storage Driver: devicemapper Pool Name: docker-202:2-25583803-pool Pool Blocksize: 65.54 kB Base Device Size: 10.74 GB Backing Filesystem: xfs Data file: /dev/loop0 Metadata file: /dev/loop1 Data Space Used: 1.68 GB Data Space Total: 107.4 GB Data Space Available: 7.548 GB Metadata Space Used: 2.322 MB Metadata Space Total: 2.147 GB Metadata Space Available: 2.145 GB Udev Sync Supported: true Deferred Removal Enabled: false Deferred Deletion Enabled: false Deferred Deleted Device Count: 0 Data loop file: /var/lib/docker/devicemapper/devicemapper/data Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata Library Version: 1.02.107-RHEL7 (2015-12-01) Execution Driver: native-0.2 Logging Driver: json-file Plugins: Volume: local Network: null host bridge Kernel Version: 3.10.0-327.el7.x86_64 Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 991.7 MiB Name: ip-172-30-0-91.ec2.internal ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S Docker Root Dir: /var/lib/docker Debug Mode: false Username: gordontheturtle Registry: https://index.docker.io/v1/ Insecure registries: myinsecurehost:5000 127.0.0.0/8
格式化输出
你可以指定格式进行输出
$ docker info --format '{{json .}}'{"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}