查看docker info的帮助信息,如下:
[root@localhost ~]# docker info --help
Usage: docker info [OPTIONS]
Display system-wide information
Options:
-f, --format string Format the output using the given Go template该命令用来显示整个系统的信息。其中:
-f, --format string 使用给定的Go模板格式化输出信息。
实例:显示当前Docker的信息,如下:
[root@localhost ~]# docker info
Containers: 2 容器数
Running: 0 正在运行的容器数
Paused: 0 暂停的容器数
Stopped: 2 停止的容器数
Images: 3 镜像数
Server Version: 18.09.6 服务器版本
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
...
Kernel Version: 3.10.0-957.el7.x86_64
Operating System: CentOS Linux 7 (Core) 操作系统
OSType: linux 操作系统类型
Architecture: x86_64 CPU架构
CPUs: 1 CPU数
Total Memory: 972.6MiB 总内存数
Name: localhost.localdomain
...
Live Restore Enabled: false
Product License: Community Engine
[root@localhost ~]#使用 docker help 命令可以查看 docker 的所有命令信息。如下:
[root@localhost ~]# docker help
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default "/root/.docker")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")
--tlskey string Path to TLS key file (default "/root/.docker/key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Management Commands:
builder Manage builds
...还可以使用“docker command help”查看某个 command 的帮助信息。如下:
[root@localhost ~]# docker rm --help
Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
Remove one or more containers
Options:
-f, --force Force the removal of a running container (uses SIGKILL)
-l, --link Remove the specified link
-v, --volumes Remove the volumes associated with the container该命令用来查看docker当前版本信息。帮助文档如下:
[root@localhost ~]# docker version --help
Usage: docker version [OPTIONS]
Show the Docker version information
Options:
-f, --format string Format the output using the given Go template
--kubeconfig string Kubernetes config file其中:
-f, --format string 使用指定的Go模板格式化输出
--kubeconfig string Kubernetes配置文件
实例:显示当前docker的版本信息。
[root@localhost ~]# docker version
Client:
Version: 18.09.7
API version: 1.39
Go version: go1.10.8
Git commit: 2d0083d
Built: Thu Jun 27 17:56:06 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.7
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 2d0083d
Built: Thu Jun 27 17:26:28 2019
OS/Arch: linux/amd64
Experimental: false