记录:366
场景:在CentOS 7.9操作系统上,Docker管理命令应用。
版本:
操作系统:CentOS 7.9
Docker版本:Docker 19.03.15
1.Docker常用操作
1.1下载镜像
命令格式:docker pull 镜像名称:镜像版本
命令实例:docker pull redis:6.2.8
解析:使用docker pull下载,从容器镜像仓库下载下载。
1.2查看镜像列表
命令格式:docker images [OPTIONS] [REPOSITORY[:TAG]]
命令实例:docker images
命令实例:docker images redis
命令实例:docker images redis:6.2.8
解析:查看本地仓库镜像列表。
1.3搜索镜像
命令格式:docker search [OPTIONS] 镜像名称关键字
命令实例:docker search httpd
解析:从Docker Hub中搜索镜像。
1.4创建容器
(1)docker create创建
创建容器:docker create --name redis-27013 -p 27013:6379 redis:6.2.8
解析:使用docker create创建容器,创建完成后不会立运行容器,需使用命令启动。
(2)docker run创建并运行
创建容器:docker run -dit --name redis-27012 -p 27012:6379 redis:6.2.8
解析:使用docker run创建容器,创建完成后会立即运行容器。
1.5查看容器列表
命令格式:docker ps [OPTIONS]
命令实例:docker ps
命令实例:docker ps -a
解析:默认展现正在运行容器;-a,各种状态都会展现。
1.6启动容器
命令格式:docker start [OPTIONS] CONTAINER [CONTAINER...]
命令格式:docker start 容器ID
命令实例:docker start 8073e0bd334c
解析:启动已经创建的完成的容器。
1.7停止容器
命令格式:docker stop [OPTIONS] CONTAINER [CONTAINER...]
命令格式:docker stop 容器ID
命令实例:docker stop 8073e0bd334c
解析:停止容器会返回容器ID。
1.8重启容器
命令格式:docker restart [OPTIONS] CONTAINER [CONTAINER...]
命令格式:docker restart 容器ID
命令实例:docker restart 8073e0bd334c
解析:重启容器会返回容器ID。
1.9进入容器
命令格式:docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
命令格式:docker exec 容器ID 命令
命令实例:docker exec -it 8073e0bd334c /bin/bash
命令实例:docker exec -it 8073e0bd334c bash
命令实例:docker exec -it redis-27012 bash
退出容器:exit
解析:执行docker exec命令时,使用容器ID和容器名称都可以进入容器内部。
1.10查看容器基础信息
命令格式:docker inspect [OPTIONS] NAME|ID [NAME|ID...]
命令格式:docker inspect 容器ID
命令实例:docker inspect b28cd322912a
解析:以JSON格式返回容器的基础信息,比如容器的ID、状态、镜像等常见配置信息;比如容器与宿主机之间的网络、端口、文件目录、驱动等信息。
1.11更新容器配置
命令格式:docker update [OPTIONS] CONTAINER [CONTAINER...]
命令实例:docker update --cpus 1 b28cd322912a
解析:限制cpu数量为1。
1.12 kill容器
命令格式:docker kill [OPTIONS] CONTAINER [CONTAINER...]
命令格式:docker kill 容器ID
命令实例:docker kill b28cd322912a
解析:kill容器会返回容器ID。
1.13删除容器
命令格式:docker rm [OPTIONS] CONTAINER [CONTAINER...]
命令格式:docker rm 容器ID
命令实例:docker rm 8073e0bd334c
解析:删除容器会返回容器ID。
1.15删除镜像
命令格式:docker rmi [OPTIONS] IMAGE [IMAGE...]
命令格式:docker rmi 镜像ID
命令实例:docker rmi 83a5aeccc5e0
解析:删除容器会返回镜像ID,一个有容器正在运行的镜像不能删除。
1.16查看容器日志
命令格式:docker logs [OPTIONS] 容器ID
命令实例:docker logs -f 8073e0bd334c
解析:-f,对于正在运行的容器,会持续输出日志。
1.17容器和本地文件系统之间拷贝数据
(1)本地拷贝到容器内部
命令格式:docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
命令实例:docker cp /home/apps/workInLocal/hz.txt 8073e0bd334c:/home/workInDocker
(2)容器内部拷贝到本地
命令格式:docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH
命令实例:docker cp 8073e0bd334c:/home/workInDocker/hz.txt /home/hz01.txt
1.18查看容器内部文件系统文件和目录变化
命令格式:docker diff [OPTIONS] 容器ID
命令实例:docker diff 3645454c4d2f
解析:看到容器内部的文件和目录变化,如果有的话。
1.19导出容器的文件系统
命令格式:docker export [OPTIONS] 容器ID
命令实例:docker export -o localFile 3645454c4d2f
解析:把容器内部文件系统导出到本地的一个文件。
1.20根据容器创建镜像
(1)创建镜像
命令格式:docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
命令实例:docker commit 3645454c4d2f myredis:6.2.8.1
解析:根据一个已经在运行的容器,创建一个新的镜像。
(2)查看镜像
命令:docker images myredis
解析:可以看到镜像已经生成。
(3)应用镜像
创建容器:docker run -dit --name redis-27014 -p 27014:6379 myredis:6.2.8.1
解析:使用新创建的镜像myredis:6.2.8.1,创建容器
1.21查看镜像历史信息
命令格式:docker history [OPTIONS] IMAGE
命令实例:docker history -H httpd:2.4.54
解析:可以查看镜像包历史变更信息。
1.22查看docker信息
命令实例:docker info
解析:显示docker在系统侧的信息。包括docker管理的容器、镜像、驱动、插件、以及系统信息。
1.23暂停容器
命令格式:docker pause CONTAINER [CONTAINER...]
命令格式:docker pause 容器ID
命令实例:docker pause 94a43200c09e
解析:执行后容器状态为:Paused。
1.24查看容器与宿主机之间映射端口
命令格式:docker port CONTAINER [PRIVATE_PORT[/PROTO]]
命令格式:docker port 容器ID
命令实例:docker port 94a43200c09e
解析:查看容器和本地之间端口映射。
1.25重命名容器名称
命令格式:docker rename CONTAINER NEW_NAME
命令格式:docker rename 容器ID 新名称
命令实例:docker rename 94a43200c09e myredis-27014
解析:把容器名称重新命名为myredis-27014。
1.26把镜像保存为文件
命令格式:docker save [OPTIONS] IMAGE
命令实例:docker save -o myimg 22f0fd7102c4
解析:把镜像22f0fd7102c4保存到一个文件中。
1.27查看容器的实时统计信息
命令格式:docker stats [OPTIONS] 容器ID
命令实例:docker stats 3645454c4d2f
命令实例:docker stats
解析:查看容器统计信息,包括CPU、内存、网络IO、块IO、PID等信息的实时统计。
1.28镜像修改版本号
命令格式:docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
命令实例:docker tag myredis:6.2.8.1 myredis:6.2.8.2
解析:镜像修改为版本号,只是tag变了,镜像ID、SIZE等其它字段不变。
1.29查看容器的进程信息
命令格式:docker top CONTAINER [ps OPTIONS]
命令实例:docker top 94a43200c09e
解析:查看容器的进程信息,包括UID、PID、CMD等。
1.30取消暂停
命令格式:docker unpause 容器ID
命令实例:docker unpause 94a43200c09e
解析:取消暂停,把容器的Paused状态变更为Up状态。
1.31查看docker版本
命令实例:docker version
解析:查看docker版本详细信息,包括引擎、容器、客户端等版本细节。
命令实例:docker --version
解析:只显示客户端版本信息。
1.32等待容器停止
命令格式:docker wait 容器ID
命令实例:docker wait 94a43200c09e
解析:容器停止时,能接收到返回值:0。
1.33登录Docker registry
登录本地搭建的harbor镜像仓库Registry。
命令格式:docker login [OPTIONS] [SERVER]
命令实例:docker login http://192.168.19.166:18021 -u admin -p Harbor12345
解析:http://192.168.19.166:18021是harbor服务器地址;-u是用户名;-p,指定密码。
1.34登出Docker registry
命令格式:docker logout [SERVER]
命令实例:docker logout
命令实例:docker logout http://192.168.19.166:18021
解析:默认是登出:Removing login credentials for https://index.docker.io/v1/。指定服务器和端口登出搭建的私有仓库。
1.35下载镜像(Harbor镜像仓库)
命令格式:docker pull [OPTIONS] NAME[:TAG|@DIGEST]
命令实例:docker pull 192.168.19.166:18021/library/redis-photon:v2.3.5
解析:192.168.19.166:18021,本地搭建的harbor镜像仓库;/library/redis-photon:v2.3.5是镜像仓库的实际镜像。
1.36上传镜像(Harbor镜像仓库)
(1)修改docker配置信息
修改命令:vi /etc/docker/daemon.json
修改内容:
{
"registry-mirrors":["http://192.168.19.166:18021"],
"insecure-registries":["192.168.19.166:18021"]
}
加载配置和重启docker:systemctl daemon-reload && systemctl restart docker
(2)先把本地镜像打标签
命令:docker tag redis:7.0.7 192.168.19.166:18021/library/redis:7.0.7
解析:先把镜像打标签
(3)命令行登录Docker registry(Harbor)
命令实例:docker login http://192.168.19.166:18021 -u admin -p Harbor12345
解析:http://192.168.19.166:18021是harbor服务器地址;-u是用户名;-p,指定密码。
(4)推送
命令实例:docker push 192.168.19.166:18021/library/redis:7.0.7
解析:默认对推送到docker.io/library/redis;指定推送。
(5)命令行登出Docker registry(Harbor)
命令实例:docker logout http://192.168.19.166:18021
解析:登出Docker registry(Harbor),否则一直有效。
2.Docker管理命令及参数明细
Docker管理命令,主要针对集群swarm方面操作。
2.1帮助命令docker --help
使用帮助命令docker --help,可以查看docker支持的全部命令。
命令明细[参数明细]:
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default "/root/.docker")
-c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")
-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
config Manage Docker configs
container Manage containers
context Manage contexts
engine Manage the docker engine
image Manage images
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
2.2帮助命令docker builder --help
命令明细[参数明细]:
Usage: docker builder COMMAND
Manage builds
Commands:
build Build an image from a Dockerfile
prune Remove build cache
Run 'docker builder COMMAND --help' for more information on a command.
2.2.1帮助命令docker builder build --help
命令明细[参数明细]:
Usage: docker builder build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
--build-arg list Set build-time variables
--cache-from strings Images to consider as cache sources
--cgroup-parent string Optional parent cgroup for the container
--compress Compress the build context using gzip
--cpu-period int Limit the CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit the CPU CFS (Completely Fair Scheduler) quota
-c, --cpu-shares int CPU shares (relative weight)
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
--disable-content-trust Skip image verification (default true)
-f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile')
--force-rm Always remove intermediate containers
--iidfile string Write the image ID to the file
--isolation string Container isolation technology
--label list Set metadata for an image
-m, --memory bytes Memory limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--network string Set the networking mode for the RUN instructions during build (default "default")
--no-cache Do not use cache when building the image
-o, --output stringArray Output destination (format: type=local,dest=path)
--platform string Set platform if server is multi-platform capable
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
--pull Always attempt to pull a newer version of the image
-q, --quiet Suppress the build output and print image ID on success
--rm Remove intermediate containers after a successful build (default true)
--secret stringArray Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret
--security-opt strings Security options
--shm-size bytes Size of /dev/shm
--squash Squash newly built layers into a single new layer
--ssh stringArray SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|<id>[=<socket>|<key>[,<key>]])
--stream Stream attaches to server to negotiate build context
-t, --tag list Name and optionally a tag in the 'name:tag' format
--target string Set the target build stage to build.
--ulimit ulimit Ulimit options (default [])
2.2.2帮助命令docker builder prune --help
命令明细[参数明细]:
Usage: docker builder prune
Remove build cache
Options:
-a, --all Remove all unused build cache, not just dangling ones
--filter filter Provide filter values (e.g. 'until=24h')
-f, --force Do not prompt for confirmation
--keep-storage bytes Amount of disk space to keep for cache
2.3帮助命令docker config --help
命令明细[参数明细]:
Usage: docker config COMMAND
Manage Docker configs
Commands:
create Create a config from a file or STDIN
inspect Display detailed information on one or more configs
ls List configs
rm Remove one or more configs
Run 'docker config COMMAND --help' for more information on a command.
2.3.1帮助命令docker config create --help
命令明细[参数明细]:
Usage: docker config create [OPTIONS] CONFIG file|-
Create a config from a file or STDIN
Options:
-l, --label list Config labels
--template-driver string Template driver
2.3.2帮助命令docker config inspect --help
命令明细[参数明细]:
Usage: docker config inspect [OPTIONS] CONFIG [CONFIG...]
Display detailed information on one or more configs
Options:
-f, --format string Format the output using the given Go template
--pretty Print the information in a human friendly format
2.3.3帮助命令docker config ls --help
命令明细[参数明细]:
Usage: docker config ls [OPTIONS]
List configs
Aliases:
ls, list
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print configs using a Go template
-q, --quiet Only display IDs
2.3.4帮助命令docker config rm --help
命令明细[参数明细]:
Usage: docker config rm CONFIG [CONFIG...]
Remove one or more configs
Aliases:
rm, remove
2.4帮助命令docker container
命令明细[参数明细]:
Usage: docker container COMMAND
Manage containers
Commands:
attach Attach local standard input, output, and error streams to a running container
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
exec Run a command in a running container
export Export a container's filesystem as a tar archive
inspect Display detailed information on one or more containers
kill Kill one or more running containers
logs Fetch the logs of a container
ls List containers
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
prune Remove all stopped containers
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
run Run a command in a new container
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
wait Block until one or more containers stop, then print their exit codes
Run 'docker container COMMAND --help' for more information on a command.
2.4.1帮助命令docker container attach --help
命令明细[参数明细]:
Usage: docker container attach [OPTIONS] CONTAINER
Attach local standard input, output, and error streams to a running container
Options:
--detach-keys string Override the key sequence for detaching a container
--no-stdin Do not attach STDIN
--sig-proxy Proxy all received signals to the process (default true)
2.4.2帮助命令docker container commit --help
命令明细[参数明细]:
Usage: docker container commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
Create a new image from a container's changes
Options:
-a, --author string Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
-c, --change list Apply Dockerfile instruction to the created image
-m, --message string Commit message
-p, --pause Pause container during commit (default true)
2.4.3帮助命令docker container cp --help
命令明细[参数明细]:
Usage: docker container cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
Copy files/folders between a container and the local filesystem
Use '-' as the source to read a tar archive from stdin
and extract it to a directory destination in a container.
Use '-' as the destination to stream a tar archive of a
container source to stdout.
Options:
-a, --archive Archive mode (copy all uid/gid information)
-L, --follow-link Always follow symbol link in SRC_PATH
2.4.4帮助命令docker container create --help
命令明细[参数明细]:
Usage: docker container create [OPTIONS] IMAGE [COMMAND] [ARG...]
Create a new container
Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
-a, --attach list Attach to STDIN, STDOUT or STDERR
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
--blkio-weight-device list Block IO weight (relative device weight) (default [])
--cap-add list Add Linux capabilities
--cap-drop list Drop Linux capabilities
--cgroup-parent string Optional parent cgroup for the container
--cidfile string Write the container ID to the file
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
--cpu-rt-period int Limit CPU real-time period in microseconds
--cpu-rt-runtime int Limit CPU real-time runtime in microseconds
-c, --cpu-shares int CPU shares (relative weight)
--cpus decimal Number of CPUs
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
--device list Add a host device to the container
--device-cgroup-rule list Add a rule to the cgroup allowed devices list
--device-read-bps list Limit read rate (bytes per second) from a device (default [])
--device-read-iops list Limit read rate (IO per second) from a device (default [])
--device-write-bps list Limit write rate (bytes per second) to a device (default [])
--device-write-iops list Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true)
--dns list Set custom DNS servers
--dns-option list Set DNS options
--dns-search list Set custom DNS search domains
--domainname string Container NIS domain name
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env list Set environment variables
--env-file list Read in a file of environment variables
--expose list Expose a port or a range of ports
--gpus gpu-request GPU devices to add to the container ('all' to pass all GPUs)
--group-add list Add additional groups to join
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ms|s|m|h) (default 0s)
--health-retries int Consecutive failures needed to report unhealthy
--health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
--health-timeout duration Maximum time to allow one check to run (ms|s|m|h) (default 0s)
--help Print usage
-h, --hostname string Container host name
--init Run an init inside the container that forwards signals and reaps processes
-i, --interactive Keep STDIN open even if not attached
--ip string IPv4 address (e.g., 172.30.100.104)
--ip6 string IPv6 address (e.g., 2001:db8::33)
--ipc string IPC mode to use
--isolation string Container isolation technology
--kernel-memory bytes Kernel memory limit
-l, --label list Set meta data on a container
--label-file list Read in a line delimited file of labels
--link list Add link to another container
--link-local-ip list Container IPv4/IPv6 link-local addresses
--log-driver string Logging driver for the container
--log-opt list Log driver options
--mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33)
-m, --memory bytes Memory limit
--memory-reservation bytes Memory soft limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
--mount mount Attach a filesystem mount to the container
--name string Assign a name to the container
--network network Connect a container to a network
--network-alias list Add network-scoped alias for the container
--no-healthcheck Disable any container-specified HEALTHCHECK
--oom-kill-disable Disable OOM Killer
--oom-score-adj int Tune host's OOM preferences (-1000 to 1000)
--pid string PID namespace to use
--pids-limit int Tune container pids limit (set -1 for unlimited)
--platform string Set platform if server is multi-platform capable
--privileged Give extended privileges to this container
-p, --publish list Publish a container's port(s) to the host
-P, --publish-all Publish all exposed ports to random ports
--read-only Mount the container's root filesystem as read only
--restart string Restart policy to apply when a container exits (default "no")
--rm Automatically remove the container when it exits
--runtime string Runtime to use for this container
--security-opt list Security Options
--shm-size bytes Size of /dev/shm
--stop-signal string Signal to stop a container (default "SIGTERM")
--stop-timeout int Timeout (in seconds) to stop a container
--storage-opt list Storage driver options for the container
--sysctl map Sysctl options (default map[])
--tmpfs list Mount a tmpfs directory
-t, --tty Allocate a pseudo-TTY
--ulimit ulimit Ulimit options (default [])
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--userns string User namespace to use
--uts string UTS namespace to use
-v, --volume list Bind mount a volume
--volume-driver string Optional volume driver for the container
--volumes-from list Mount volumes from the specified container(s)
-w, --workdir string Working directory inside the container
2.4.5帮助命令docker container diff --help
命令明细[参数明细]:
Usage: docker container diff CONTAINER
Inspect changes to files or directories on a container's filesystem
2.4.6帮助命令docker container exec --help
命令明细[参数明细]:
Usage: docker container exec [OPTIONS] CONTAINER COMMAND [ARG...]
Run a command in a running container
Options:
-d, --detach Detached mode: run command in the background
--detach-keys string Override the key sequence for detaching a container
-e, --env list Set environment variables
-i, --interactive Keep STDIN open even if not attached
--privileged Give extended privileges to the command
-t, --tty Allocate a pseudo-TTY
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
-w, --workdir string Working directory inside the container
2.4.7帮助命令docker container export --help
命令明细[参数明细]:
Usage: docker container export [OPTIONS] CONTAINER
Export a container's filesystem as a tar archive
Options:
-o, --output string Write to a file, instead of STDOUT
2.4.8帮助命令docker container inspect --help
命令明细[参数明细]:
Usage: docker container inspect [OPTIONS] CONTAINER [CONTAINER...]
Display detailed information on one or more containers
Options:
-f, --format string Format the output using the given Go template
-s, --size Display total file sizes
2.4.9帮助命令docker container kill --help
命令明细[参数明细]:
Usage: docker container kill [OPTIONS] CONTAINER [CONTAINER...]
Kill one or more running containers
Options:
-s, --signal string Signal to send to the container (default "KILL")
2.4.10帮助命令docker container logs --help
命令明细[参数明细]:
Usage: docker container logs [OPTIONS] CONTAINER
Fetch the logs of a container
Options:
--details Show extra details provided to logs
-f, --follow Follow log output
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
--tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps
--until string Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
2.4.11帮助命令docker container ls --help
命令明细[参数明细]:
Usage: docker container ls [OPTIONS]
List containers
Aliases:
ls, ps, list
Options:
-a, --all Show all containers (default shows just running)
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print containers using a Go template
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display numeric IDs
-s, --size Display total file sizes
2.4.12帮助命令docker container pause --help
命令明细[参数明细]:
Usage: docker container pause CONTAINER [CONTAINER...]
Pause all processes within one or more containers
2.4.13帮助命令docker container port --help
命令明细[参数明细]:
Usage: docker container port CONTAINER [PRIVATE_PORT[/PROTO]]
List port mappings or a specific mapping for the container
2.4.14帮助命令docker container prune --help
命令明细[参数明细]:
Usage: docker container prune [OPTIONS]
Remove all stopped containers
Options:
--filter filter Provide filter values (e.g. 'until=<timestamp>')
-f, --force Do not prompt for confirmation
2.4.15帮助命令docker container rename --help
命令明细[参数明细]:
Usage: docker container rename CONTAINER NEW_NAME
Rename a container
2.4.16帮助命令docker container restart --help
命令明细[参数明细]:
Usage: docker container restart [OPTIONS] CONTAINER [CONTAINER...]
Restart one or more containers
Options:
-t, --time int Seconds to wait for stop before killing the container (default 10)
2.4.17帮助命令docker container rm --help
命令明细[参数明细]:
Usage: docker container 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 anonymous volumes associated with the container
2.4.18帮助命令docker container run --help
命令明细[参数明细]:
Usage: docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]
Run a command in a new container
Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
-a, --attach list Attach to STDIN, STDOUT or STDERR
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
--blkio-weight-device list Block IO weight (relative device weight) (default [])
--cap-add list Add Linux capabilities
--cap-drop list Drop Linux capabilities
--cgroup-parent string Optional parent cgroup for the container
--cidfile string Write the container ID to the file
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
--cpu-rt-period int Limit CPU real-time period in microseconds
--cpu-rt-runtime int Limit CPU real-time runtime in microseconds
-c, --cpu-shares int CPU shares (relative weight)
--cpus decimal Number of CPUs
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
-d, --detach Run container in background and print container ID
--detach-keys string Override the key sequence for detaching a container
--device list Add a host device to the container
--device-cgroup-rule list Add a rule to the cgroup allowed devices list
--device-read-bps list Limit read rate (bytes per second) from a device (default [])
--device-read-iops list Limit read rate (IO per second) from a device (default [])
--device-write-bps list Limit write rate (bytes per second) to a device (default [])
--device-write-iops list Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true)
--dns list Set custom DNS servers
--dns-option list Set DNS options
--dns-search list Set custom DNS search domains
--domainname string Container NIS domain name
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env list Set environment variables
--env-file list Read in a file of environment variables
--expose list Expose a port or a range of ports
--gpus gpu-request GPU devices to add to the container ('all' to pass all GPUs)
--group-add list Add additional groups to join
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ms|s|m|h) (default 0s)
--health-retries int Consecutive failures needed to report unhealthy
--health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
--health-timeout duration Maximum time to allow one check to run (ms|s|m|h) (default 0s)
--help Print usage
-h, --hostname string Container host name
--init Run an init inside the container that forwards signals and reaps processes
-i, --interactive Keep STDIN open even if not attached
--ip string IPv4 address (e.g., 172.30.100.104)
--ip6 string IPv6 address (e.g., 2001:db8::33)
--ipc string IPC mode to use
--isolation string Container isolation technology
--kernel-memory bytes Kernel memory limit
-l, --label list Set meta data on a container
--label-file list Read in a line delimited file of labels
--link list Add link to another container
--link-local-ip list Container IPv4/IPv6 link-local addresses
--log-driver string Logging driver for the container
--log-opt list Log driver options
--mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33)
-m, --memory bytes Memory limit
--memory-reservation bytes Memory soft limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
--mount mount Attach a filesystem mount to the container
--name string Assign a name to the container
--network network Connect a container to a network
--network-alias list Add network-scoped alias for the container
--no-healthcheck Disable any container-specified HEALTHCHECK
--oom-kill-disable Disable OOM Killer
--oom-score-adj int Tune host's OOM preferences (-1000 to 1000)
--pid string PID namespace to use
--pids-limit int Tune container pids limit (set -1 for unlimited)
--platform string Set platform if server is multi-platform capable
--privileged Give extended privileges to this container
-p, --publish list Publish a container's port(s) to the host
-P, --publish-all Publish all exposed ports to random ports
--read-only Mount the container's root filesystem as read only
--restart string Restart policy to apply when a container exits (default "no")
--rm Automatically remove the container when it exits
--runtime string Runtime to use for this container
--security-opt list Security Options
--shm-size bytes Size of /dev/shm
--sig-proxy Proxy received signals to the process (default true)
--stop-signal string Signal to stop a container (default "SIGTERM")
--stop-timeout int Timeout (in seconds) to stop a container
--storage-opt list Storage driver options for the container
--sysctl map Sysctl options (default map[])
--tmpfs list Mount a tmpfs directory
-t, --tty Allocate a pseudo-TTY
--ulimit ulimit Ulimit options (default [])
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--userns string User namespace to use
--uts string UTS namespace to use
-v, --volume list Bind mount a volume
--volume-driver string Optional volume driver for the container
--volumes-from list Mount volumes from the specified container(s)
-w, --workdir string
2.4.19帮助命令docker container start --help
命令明细[参数明细]:
Usage: docker container start [OPTIONS] CONTAINER [CONTAINER...]
Start one or more stopped containers
Options:
-a, --attach Attach STDOUT/STDERR and forward signals
--checkpoint string Restore from this checkpoint
--checkpoint-dir string Use a custom checkpoint storage directory
--detach-keys string Override the key sequence for detaching a container
-i, --interactive Attach container's STDIN
2.4.20帮助命令docker container stats --help
命令明细[参数明细]:
Usage: docker container stats [OPTIONS] [CONTAINER...]
Display a live stream of container(s) resource usage statistics
Options:
-a, --all Show all containers (default shows just running)
--format string Pretty-print images using a Go template
--no-stream Disable streaming stats and only pull the first result
--no-trunc Do not truncate output
2.4.21帮助命令docker container stop --help
命令明细[参数明细]:
Usage: docker container stop [OPTIONS] CONTAINER [CONTAINER...]
Stop one or more running containers
Options:
-t, --time int Seconds to wait for stop before killing it (default 10)
2.4.22帮助命令docker container top --help
命令明细[参数明细]:
Usage: docker container top CONTAINER [ps OPTIONS]
Display the running processes of a container
2.4.23帮助命令docker container unpause --help
命令明细[参数明细]:
Usage: docker container unpause CONTAINER [CONTAINER...]
Unpause all processes within one or more containers
2.4.24帮助命令docker container update --help
命令明细[参数明细]:
Usage: docker container update [OPTIONS] CONTAINER [CONTAINER...]
Update configuration of one or more containers
Options:
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
--cpu-rt-period int Limit the CPU real-time period in microseconds
--cpu-rt-runtime int Limit the CPU real-time runtime in microseconds
-c, --cpu-shares int CPU shares (relative weight)
--cpus decimal Number of CPUs
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
--kernel-memory bytes Kernel memory limit
-m, --memory bytes Memory limit
--memory-reservation bytes Memory soft limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--pids-limit int Tune container pids limit (set -1 for unlimited)
--restart string Restart policy to apply when a container exits
2.4.25帮助命令docker container wait --help
命令明细[参数明细]:
Usage: docker container wait CONTAINER [CONTAINER...]
Block until one or more containers stop, then print their exit codes
2.5帮助命令docker context --help
命令明细[参数明细]:
Usage: docker context COMMAND
Manage contexts
Commands:
create Create a context
export Export a context to a tar or kubeconfig file
import Import a context from a tar or zip file
inspect Display detailed information on one or more contexts
ls List contexts
rm Remove one or more contexts
update Update a context
use Set the current docker context
Run 'docker context COMMAND --help' for more information on a command.
2.5.1帮助命令docker context create --help
命令明细[参数明细]:
Usage: docker context create [OPTIONS] CONTEXT
Create a context
Docker endpoint config:
NAME DESCRIPTION
from Copy named context's Docker endpoint configuration
host Docker endpoint on which to connect
ca Trust certs signed only by this CA
cert Path to TLS certificate file
key Path to TLS key file
skip-tls-verify Skip TLS certificate validation
Kubernetes endpoint config:
NAME DESCRIPTION
from Copy named context's Kubernetes endpoint configuration
config-file Path to a Kubernetes config file
context-override Overrides the context set in the kubernetes config file
namespace-override Overrides the namespace set in the kubernetes config file
Example:
$ docker context create my-context --description "some description" --docker "host=tcp://myserver:2376,ca=~/ca-file,cert=~/cert-file,key=~/key-file"
Options:
--default-stack-orchestrator string Default orchestrator for stack operations to use with this context (swarm|kubernetes|all)
--description string Description of the context
--docker stringToString set the docker endpoint (default [])
--from string create context from a named context
--kubernetes stringToString set the kubernetes endpoint (default [])
2.5.2帮助命令docker context export --help
命令明细[参数明细]:
Usage: docker context export [OPTIONS] CONTEXT [FILE|-]
Export a context to a tar or kubeconfig file
Options:
--kubeconfig Export as a kubeconfig file
2.5.3帮助命令docker context import --help
命令明细[参数明细]:
Usage: docker context import CONTEXT FILE|-
Import a context from a tar or zip file
2.5.4帮助命令docker context inspect --help
命令明细[参数明细]:
Usage: docker context inspect [OPTIONS] [CONTEXT] [CONTEXT...]
Display detailed information on one or more contexts
Options:
-f, --format string Format the output using the given Go template
2.5.5帮助命令docker context ls --help
命令明细[参数明细]:
Usage: docker context ls [OPTIONS]
List contexts
Aliases:
ls, list
Options:
--format string Pretty-print contexts using a Go template
-q, --quiet Only show context names
2.5.6帮助命令docker context rm --help
命令明细[参数明细]:
Usage: docker context rm CONTEXT [CONTEXT...]
Remove one or more contexts
Aliases:
rm, remove
Options:
-f, --force Force the removal of a context in use
2.5.7帮助命令docker context update --help
命令明细[参数明细]:
Usage: docker context update [OPTIONS] CONTEXT
Update a context
Docker endpoint config:
NAME DESCRIPTION
from Copy named context's Docker endpoint configuration
host Docker endpoint on which to connect
ca Trust certs signed only by this CA
cert Path to TLS certificate file
key Path to TLS key file
skip-tls-verify Skip TLS certificate validation
Kubernetes endpoint config:
NAME DESCRIPTION
from Copy named context's Kubernetes endpoint configuration
config-file Path to a Kubernetes config file
context-override Overrides the context set in the kubernetes config file
namespace-override Overrides the namespace set in the kubernetes config file
Example:
$ docker context update my-context --description "some description" --docker "host=tcp://myserver:2376,ca=~/ca-file,cert=~/cert-file,key=~/key-file"
Options:
--default-stack-orchestrator string Default orchestrator for stack operations to use with this context (swarm|kubernetes|all)
--description string Description of the context
--docker stringToString set the docker endpoint (default [])
--kubernetes stringToString set the kubernetes endpoint (default [])
2.5.8帮助命令docker context use --help
命令明细[参数明细]:
Usage: docker context use CONTEXT
Set the current docker context
2.6帮助命令docker engine --help
命令明细[参数明细]:
Usage: docker engine COMMAND
Manage the docker engine
Commands:
activate Activate Enterprise Edition
check Check for available engine updates
update Update a local engine
Run 'docker engine COMMAND --help' for more information on a command.
2.6.1帮助命令docker engine activate --help
命令明细[参数明细]:
Usage: docker engine activate [OPTIONS]
Activate Enterprise Edition.
With this command you may apply an existing Docker enterprise license, or
interactively download one from Docker. In the interactive exchange, you can
sign up for a new trial, or download an existing license. If you are
currently running a Community Edition engine, the daemon will be updated to
the Enterprise Edition Docker engine with additional capabilities and long
term support.
For more information about different Docker Enterprise license types visit
https://www.docker.com/licenses
For non-interactive scriptable deployments, download your license from
https://hub.docker.com/ then specify the file with the '--license' flag.
Options:
--containerd string override default location of containerd endpoint
--display-only only display license information and exit
--engine-image string Specify engine image
--format string Pretty-print licenses using a Go template
--license string License File
--quiet Only display available licenses by ID
--registry-prefix string Override the default location where engine images are pulled (default "docker.io/store/docker")
--version string Specify engine version (default is to use currently running version)
2.6.2帮助命令docker engine check --help
命令明细[参数明细]:
Usage: docker engine check [OPTIONS]
Check for available engine updates
Options:
--containerd string override default location of containerd endpoint
--downgrades Report downgrades (default omits older versions)
--engine-image string Specify engine image (default uses the same image as currently running)
--format string Pretty-print updates using a Go template
--pre-releases Include pre-release versions
-q, --quiet Only display available versions
--registry-prefix string Override the existing location where engine images are pulled (default "docker.io/store/docker")
--upgrades Report available upgrades (default true)
2.6.3帮助命令docker engine update --help
命令明细[参数明细]:
Usage: docker engine update [OPTIONS]
Update a local engine
Options:
--containerd string override default location of containerd endpoint
--engine-image string Specify engine image (default uses the same image as currently running)
--registry-prefix string Override the current location where engine images are pulled (default "docker.io/store/docker")
--version string Specify engine version
2.7帮助命令docker image --help
命令明细[参数明细]:
Usage: docker image COMMAND
Manage images
Commands:
build Build an image from a Dockerfile
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Display detailed information on one or more images
load Load an image from a tar archive or STDIN
ls List images
prune Remove unused images
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rm Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
Run 'docker image COMMAND --help' for more information on a command.
2.7.1帮助命令docker image build --help
命令明细[参数明细]:
Usage: docker image build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
--build-arg list Set build-time variables
--cache-from strings Images to consider as cache sources
--cgroup-parent string Optional parent cgroup for the container
--compress Compress the build context using gzip
--cpu-period int Limit the CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit the CPU CFS (Completely Fair Scheduler) quota
-c, --cpu-shares int CPU shares (relative weight)
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
--disable-content-trust Skip image verification (default true)
-f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile')
--force-rm Always remove intermediate containers
--iidfile string Write the image ID to the file
--isolation string Container isolation technology
--label list Set metadata for an image
-m, --memory bytes Memory limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--network string Set the networking mode for the RUN instructions during build (default "default")
--no-cache Do not use cache when building the image
-o, --output stringArray Output destination (format: type=local,dest=path)
--platform string Set platform if server is multi-platform capable
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
--pull Always attempt to pull a newer version of the image
-q, --quiet Suppress the build output and print image ID on success
--rm Remove intermediate containers after a successful build (default true)
--secret stringArray Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret
--security-opt strings Security options
--shm-size bytes Size of /dev/shm
--squash Squash newly built layers into a single new layer
--ssh stringArray SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|<id>[=<socket>|<key>[,<key>]])
--stream Stream attaches to server to negotiate build context
-t, --tag list Name and optionally a tag in the 'name:tag' format
--target string Set the target build stage to build.
--ulimit ulimit Ulimit options (default [])
2.7.2帮助命令docker image history --help
命令明细[参数明细]:
Usage: docker image history [OPTIONS] IMAGE
Show the history of an image
Options:
--format string Pretty-print images using a Go template
-H, --human Print sizes and dates in human readable format (default true)
--no-trunc Don't truncate output
-q, --quiet Only show numeric IDs
2.7.3帮助命令docker image import --help
命令明细[参数明细]:
Usage: docker image import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]
Import the contents from a tarball to create a filesystem image
Options:
-c, --change list Apply Dockerfile instruction to the created image
-m, --message string Set commit message for imported image
--platform string Set platform if server is multi-platform capable
2.7.4帮助命令docker image inspect --help
命令明细[参数明细]:
Usage: docker image inspect [OPTIONS] IMAGE [IMAGE...]
Display detailed information on one or more images
Options:
-f, --format string Format the output using the given Go template
2.7.5帮助命令docker image load --help
命令明细[参数明细]:
Usage: docker image load [OPTIONS]
Load an image from a tar archive or STDIN
Options:
-i, --input string Read from tar archive file, instead of STDIN
-q, --quiet Suppress the load output
2.7.6帮助命令docker image ls --help
命令明细[参数明细]:
Usage: docker image ls [OPTIONS] [REPOSITORY[:TAG]]
List images
Aliases:
ls, images, list
Options:
-a, --all Show all images (default hides intermediate images)
--digests Show digests
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print images using a Go template
--no-trunc Don't truncate output
-q, --quiet Only show numeric IDs
2.7.7帮助命令docker image prune --help
命令明细[参数明细]:
Usage: docker image prune [OPTIONS]
Remove unused images
Options:
-a, --all Remove all unused images, not just dangling ones
--filter filter Provide filter values (e.g. 'until=<timestamp>')
-f, --force Do not prompt for confirmation
2.7.8帮助命令docker image pull --help
命令明细[参数明细]:
Usage: docker image pull [OPTIONS] NAME[:TAG|@DIGEST]
Pull an image or a repository from a registry
Options:
-a, --all-tags Download all tagged images in the repository
--disable-content-trust Skip image verification (default true)
--platform string Set platform if server is multi-platform capable
-q, --quiet Suppress verbose output
2.7.9帮助命令docker image push --help
命令明细[参数明细]:
Usage: docker image push [OPTIONS] NAME[:TAG]
Push an image or a repository to a registry
Options:
--disable-content-trust Skip image signing (default true)
2.7.10帮助命令docker image rm --help
命令明细[参数明细]:
Usage: docker image rm [OPTIONS] IMAGE [IMAGE...]
Remove one or more images
Aliases:
rm, rmi, remove
Options:
-f, --force Force removal of the image
--no-prune Do not delete untagged parents
2.7.11帮助命令docker image save --help
命令明细[参数明细]:
Usage: docker image save [OPTIONS] IMAGE [IMAGE...]
Save one or more images to a tar archive (streamed to STDOUT by default)
Options:
-o, --output string Write to a file, instead of STDOUT
2.7.12帮助命令docker image tag --help
命令明细[参数明细]:
Usage: docker image tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
2.8帮助命令docker network --help
命令明细[参数明细]:
Usage: docker network COMMAND
Manage networks
Commands:
connect Connect a container to a network
create Create a network
disconnect Disconnect a container from a network
inspect Display detailed information on one or more networks
ls List networks
prune Remove all unused networks
rm Remove one or more networks
Run 'docker network COMMAND --help' for more information on a command.
2.8.1帮助命令docker network connect --help
命令明细[参数明细]:
Usage: docker network connect [OPTIONS] NETWORK CONTAINER
Connect a container to a network
Options:
--alias strings Add network-scoped alias for the container
--driver-opt strings driver options for the network
--ip string IPv4 address (e.g., 172.30.100.104)
--ip6 string IPv6 address (e.g., 2001:db8::33)
--link list Add link to another container
--link-local-ip strings Add a link-local address for the container
2.8.2帮助命令docker network create --help
命令明细[参数明细]:
Usage: docker network create [OPTIONS] NETWORK
Create a network
Options:
--attachable Enable manual container attachment
--aux-address map Auxiliary IPv4 or IPv6 addresses used by Network driver (default map[])
--config-from string The network from which copying the configuration
--config-only Create a configuration only network
-d, --driver string Driver to manage the Network (default "bridge")
--gateway strings IPv4 or IPv6 Gateway for the master subnet
--ingress Create swarm routing-mesh network
--internal Restrict external access to the network
--ip-range strings Allocate container ip from a sub-range
--ipam-driver string IP Address Management Driver (default "default")
--ipam-opt map Set IPAM driver specific options (default map[])
--ipv6 Enable IPv6 networking
--label list Set metadata on a network
-o, --opt map Set driver specific options (default map[])
--scope string Control the network's scope
--subnet strings Subnet in CIDR format that represents a network segment
2.8.3帮助命令docker network disconnect --help
命令明细[参数明细]:
Usage: docker network disconnect [OPTIONS] NETWORK CONTAINER
Disconnect a container from a network
Options:
-f, --force Force the container to disconnect from a network
2.8.4帮助命令docker network inspect --help
命令明细[参数明细]:
Usage: docker network inspect [OPTIONS] NETWORK [NETWORK...]
Display detailed information on one or more networks
Options:
-f, --format string Format the output using the given Go template
-v, --verbose Verbose output for diagnostics
2.8.5帮助命令docker network ls --help
命令明细[参数明细]:
Usage: docker network ls [OPTIONS]
List networks
Aliases:
ls, list
Options:
-f, --filter filter Provide filter values (e.g. 'driver=bridge')
--format string Pretty-print networks using a Go template
--no-trunc Do not truncate the output
-q, --quiet Only display network IDs
2.8.6帮助命令docker network prune --help
命令明细[参数明细]:
Usage: docker network prune [OPTIONS]
Remove all unused networks
Options:
--filter filter Provide filter values (e.g. 'until=<timestamp>')
-f, --force Do not prompt for confirmation
2.8.7帮助命令docker network rm --help
命令明细[参数明细]:
Usage: docker network rm NETWORK [NETWORK...]
Remove one or more networks
Aliases:
rm, remove
2.9帮助命令docker node --help
命令明细[参数明细]:
Usage: docker node COMMAND
Manage Swarm nodes
Commands:
demote Demote one or more nodes from manager in the swarm
inspect Display detailed information on one or more nodes
ls List nodes in the swarm
promote Promote one or more nodes to manager in the swarm
ps List tasks running on one or more nodes, defaults to current node
rm Remove one or more nodes from the swarm
update Update a node
Run 'docker node COMMAND --help' for more information on a command.
2.9.1帮助命令docker node demote --help
命令明细[参数明细]:
Usage: docker node demote NODE [NODE...]
Demote one or more nodes from manager in the swarm
2.9.2帮助命令docker node promote --help
命令明细[参数明细]:
Usage: docker node promote NODE [NODE...]
Promote one or more nodes to manager in the swarm
2.9.3帮助命令docker node ls --help
命令明细[参数明细]:
Usage: docker node ls [OPTIONS]
List nodes in the swarm
Aliases:
ls, list
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print nodes using a Go template
-q, --quiet Only display IDs
2.9.4帮助命令docker node promote --help
命令明细[参数明细]:
Usage: docker node promote NODE [NODE...]
Promote one or more nodes to manager in the swarm
2.9.5帮助命令docker node ps --help
命令明细[参数明细]:
Usage: docker node ps [OPTIONS] [NODE...]
List tasks running on one or more nodes, defaults to current node
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print tasks using a Go template
--no-resolve Do not map IDs to Names
--no-trunc Do not truncate output
-q, --quiet Only display task IDs
2.9.6帮助命令docker node rm --help
命令明细[参数明细]:
Usage: docker node rm [OPTIONS] NODE [NODE...]
Remove one or more nodes from the swarm
Aliases:
rm, remove
Options:
-f, --force Force remove a node from the swarm
2.9.7帮助命令docker node update --help
命令明细[参数明细]:
Usage: docker node update [OPTIONS] NODE
Update a node
Options:
--availability string Availability of the node ("active"|"pause"|"drain")
--label-add list Add or update a node label (key=value)
--label-rm list Remove a node label if exists
--role string Role of the node ("worker"|"manager")
2.10帮助命令docker plugin --help
命令明细[参数明细]:
Usage: docker plugin COMMAND
Manage plugins
Commands:
create Create a plugin from a rootfs and configuration. Plugin data directory must contain config.json and rootfs directory.
disable Disable a plugin
enable Enable a plugin
inspect Display detailed information on one or more plugins
install Install a plugin
ls List plugins
push Push a plugin to a registry
rm Remove one or more plugins
set Change settings for a plugin
upgrade Upgrade an existing plugin
Run 'docker plugin COMMAND --help' for more information on a command.
2.10.1帮助命令docker plugin create --help
命令明细[参数明细]:
Usage: docker plugin create [OPTIONS] PLUGIN PLUGIN-DATA-DIR
Create a plugin from a rootfs and configuration. Plugin data directory must contain config.json and rootfs directory.
Options:
--compress Compress the context using gzip
2.10.2帮助命令docker plugin disable --help
命令明细[参数明细]:
Usage: docker plugin disable [OPTIONS] PLUGIN
Disable a plugin
Options:
-f, --force Force the disable of an active plugin
2.10.3帮助命令docker plugin enable --help
命令明细[参数明细]:
Usage: docker plugin enable [OPTIONS] PLUGIN
Enable a plugin
Options:
--timeout int HTTP client timeout (in seconds) (default 30)
2.10.4帮助命令docker plugin inspect --help
命令明细[参数明细]:
Usage: docker plugin inspect [OPTIONS] PLUGIN [PLUGIN...]
Display detailed information on one or more plugins
Options:
-f, --format string Format the output using the given Go template
2.10.5帮助命令docker plugin install --help
命令明细[参数明细]:
Usage: docker plugin install [OPTIONS] PLUGIN [KEY=VALUE...]
Install a plugin
Options:
--alias string Local name for plugin
--disable Do not enable the plugin on install
--disable-content-trust Skip image verification (default true)
--grant-all-permissions Grant all permissions necessary to run the plugin
2.10.6帮助命令docker plugin ls --help
命令明细[参数明细]:
Usage: docker plugin ls [OPTIONS]
List plugins
Aliases:
ls, list
Options:
-f, --filter filter Provide filter values (e.g. 'enabled=true')
--format string Pretty-print plugins using a Go template
--no-trunc Don't truncate output
-q, --quiet Only display plugin IDs
2.10.7帮助命令docker plugin push --help
命令明细[参数明细]:
Usage: docker plugin push [OPTIONS] PLUGIN[:TAG]
Push a plugin to a registry
Options:
--disable-content-trust Skip image signing (default true)
2.10.8帮助命令docker plugin rm --help
命令明细[参数明细]:
Usage: docker plugin rm [OPTIONS] PLUGIN [PLUGIN...]
Remove one or more plugins
Aliases:
rm, remove
Options:
-f, --force Force the removal of an active plugin
2.10.9帮助命令docker plugin set --help
命令明细[参数明细]:
Usage: docker plugin set PLUGIN KEY=VALUE [KEY=VALUE...]
Change settings for a plugin
2.10.10帮助命令docker plugin upgrade --help
命令明细[参数明细]:
Usage: docker plugin upgrade [OPTIONS] PLUGIN [REMOTE]
Upgrade an existing plugin
Options:
--disable-content-trust Skip image verification (default true)
--grant-all-permissions Grant all permissions necessary to run the plugin
--skip-remote-check Do not check if specified remote plugin matches existing plugin image
2.11帮助命令docker secret --help
命令明细[参数明细]:
Usage: docker secret COMMAND
Manage Docker secrets
Commands:
create Create a secret from a file or STDIN as content
inspect Display detailed information on one or more secrets
ls List secrets
rm Remove one or more secrets
Run 'docker secret COMMAND --help' for more information on a command.
2.11.1帮助命令docker secret create --help
命令明细[参数明细]:
Usage: docker secret create [OPTIONS] SECRET [file|-]
Create a secret from a file or STDIN as content
Options:
-d, --driver string Secret driver
-l, --label list Secret labels
--template-driver string Template driver
2.11.2帮助命令docker secret inspect --help
命令明细[参数明细]:
Usage: docker secret inspect [OPTIONS] SECRET [SECRET...]
Display detailed information on one or more secrets
Options:
-f, --format string Format the output using the given Go template
--pretty Print the information in a human friendly format
2.11.3帮助命令docker secret ls --help
命令明细[参数明细]:
Usage: docker secret ls [OPTIONS]
List secrets
Aliases:
ls, list
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print secrets using a Go template
-q, --quiet Only display IDs
2.11.4帮助命令docker secret rm --help
命令明细[参数明细]:
Usage: docker secret rm SECRET [SECRET...]
Remove one or more secrets
Aliases:
rm, remove
2.12帮助命令docker service --help
命令明细[参数明细]:
Usage: docker service COMMAND
Manage services
Commands:
create Create a new service
inspect Display detailed information on one or more services
logs Fetch the logs of a service or task
ls List services
ps List the tasks of one or more services
rm Remove one or more services
rollback Revert changes to a service's configuration
scale Scale one or multiple replicated services
update Update a service
Run 'docker service COMMAND --help' for more information on a command.
2.12.1帮助命令docker service create --help
命令明细[参数明细]:
Usage: docker service create [OPTIONS] IMAGE [COMMAND] [ARG...]
Create a new service
Options:
--config config Specify configurations to expose to the service
--constraint list Placement constraints
--container-label list Container labels
--credential-spec credential-spec Credential spec for managed service account (Windows only)
-d, --detach Exit immediately instead of waiting for the service to converge
--dns list Set custom DNS servers
--dns-option list Set DNS options
--dns-search list Set custom DNS search domains
--endpoint-mode string Endpoint mode (vip or dnsrr) (default "vip")
--entrypoint command Overwrite the default ENTRYPOINT of the image
-e, --env list Set environment variables
--env-file list Read in a file of environment variables
--generic-resource list User defined resources
--group list Set one or more supplementary user groups for the container
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ms|s|m|h)
--health-retries int Consecutive failures needed to report unhealthy
--health-start-period duration Start period for the container to initialize before counting retries towards unstable (ms|s|m|h)
--health-timeout duration Maximum time to allow one check to run (ms|s|m|h)
--host list Set one or more custom host-to-IP mappings (host:ip)
--hostname string Container hostname
--init Use an init inside each service container to forward signals and reap processes
--isolation string Service container isolation mode
-l, --label list Service labels
--limit-cpu decimal Limit CPUs
--limit-memory bytes Limit Memory
--log-driver string Logging driver for service
--log-opt list Logging driver options
--mode string Service mode (replicated or global) (default "replicated")
--mount mount Attach a filesystem mount to the service
--name string Service name
--network network Network attachments
--no-healthcheck Disable any container-specified HEALTHCHECK
--no-resolve-image Do not query the registry to resolve image digest and supported platforms
--placement-pref pref Add a placement preference
-p, --publish port Publish a port as a node port
-q, --quiet Suppress progress output
--read-only Mount the container's root filesystem as read only
--replicas uint Number of tasks
--replicas-max-per-node uint Maximum number of tasks per node (default 0 = unlimited)
--reserve-cpu decimal Reserve CPUs
--reserve-memory bytes Reserve Memory
--restart-condition string Restart when condition is met ("none"|"on-failure"|"any") (default "any")
--restart-delay duration Delay between restart attempts (ns|us|ms|s|m|h) (default 5s)
--restart-max-attempts uint Maximum number of restarts before giving up
--restart-window duration Window used to evaluate the restart policy (ns|us|ms|s|m|h)
--rollback-delay duration Delay between task rollbacks (ns|us|ms|s|m|h) (default 0s)
--rollback-failure-action string Action on rollback failure ("pause"|"continue") (default "pause")
--rollback-max-failure-ratio float Failure rate to tolerate during a rollback (default 0)
--rollback-monitor duration Duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) (default 5s)
--rollback-order string Rollback order ("start-first"|"stop-first") (default "stop-first")
--rollback-parallelism uint Maximum number of tasks rolled back simultaneously (0 to roll back all at once) (default 1)
--secret secret Specify secrets to expose to the service
--stop-grace-period duration Time to wait before force killing a container (ns|us|ms|s|m|h) (default 10s)
--stop-signal string Signal to stop the container
--sysctl list Sysctl options
-t, --tty Allocate a pseudo-TTY
--update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s)
--update-failure-action string Action on update failure ("pause"|"continue"|"rollback") (default "pause")
--update-max-failure-ratio float Failure rate to tolerate during an update (default 0)
--update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 5s)
--update-order string Update order ("start-first"|"stop-first") (default "stop-first")
--update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1)
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--with-registry-auth Send registry authentication details to swarm agents
-w, --workdir string Working directory inside the container
2.12.2帮助命令docker service inspect --help
命令明细[参数明细]:
Usage: docker service inspect [OPTIONS] SERVICE [SERVICE...]
Display detailed information on one or more services
Options:
-f, --format string Format the output using the given Go template
--pretty Print the information in a human friendly format
2.12.3帮助命令docker service logs --help
命令明细[参数明细]:
Usage: docker service logs [OPTIONS] SERVICE|TASK
Fetch the logs of a service or task
Options:
--details Show extra details provided to logs
-f, --follow Follow log output
--no-resolve Do not map IDs to Names in output
--no-task-ids Do not include task IDs in output
--no-trunc Do not truncate output
--raw Do not neatly format logs
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
--tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps
2.12.4帮助命令docker service ls --help
命令明细[参数明细]:
Usage: docker service ls [OPTIONS]
List services
Aliases:
ls, list
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print services using a Go template
-q, --quiet Only display IDs
2.12.5帮助命令docker service ps --help
命令明细[参数明细]:
Usage: docker service ps [OPTIONS] SERVICE [SERVICE...]
List the tasks of one or more services
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print tasks using a Go template
--no-resolve Do not map IDs to Names
--no-trunc Do not truncate output
-q, --quiet Only display task IDs
2.12.6帮助命令docker service rm --help
命令明细[参数明细]:
Usage: docker service rm SERVICE [SERVICE...]
Remove one or more services
Aliases:
rm, remove
2.12.7帮助命令docker service rollback --help
命令明细[参数明细]:
Usage: docker service rollback [OPTIONS] SERVICE
Revert changes to a service's configuration
Options:
-d, --detach Exit immediately instead of waiting for the service to converge
-q, --quiet Suppress progress output
2.12.8帮助命令docker service scale --help
命令明细[参数明细]:
Usage: docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...]
Scale one or multiple replicated services
Options:
-d, --detach Exit immediately instead of waiting for the service to converge
2.12.9帮助命令docker service update --help
命令明细[参数明细]:
Usage: docker service update [OPTIONS] SERVICE
Update a service
Options:
--args command Service command args
--config-add config Add or update a config file on a service
--config-rm list Remove a configuration file
--constraint-add list Add or update a placement constraint
--constraint-rm list Remove a constraint
--container-label-add list Add or update a container label
--container-label-rm list Remove a container label by its key
--credential-spec credential-spec Credential spec for managed service account (Windows only)
-d, --detach Exit immediately instead of waiting for the service to converge
--dns-add list Add or update a custom DNS server
--dns-option-add list Add or update a DNS option
--dns-option-rm list Remove a DNS option
--dns-rm list Remove a custom DNS server
--dns-search-add list Add or update a custom DNS search domain
--dns-search-rm list Remove a DNS search domain
--endpoint-mode string Endpoint mode (vip or dnsrr)
--entrypoint command Overwrite the default ENTRYPOINT of the image
--env-add list Add or update an environment variable
--env-rm list Remove an environment variable
--force Force update even if no changes require it
--generic-resource-add list Add a Generic resource
--generic-resource-rm list Remove a Generic resource
--group-add list Add an additional supplementary user group to the container
--group-rm list Remove a previously added supplementary user group from the container
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ms|s|m|h)
--health-retries int Consecutive failures needed to report unhealthy
--health-start-period duration Start period for the container to initialize before counting retries towards unstable (ms|s|m|h)
--health-timeout duration Maximum time to allow one check to run (ms|s|m|h)
--host-add list Add a custom host-to-IP mapping (host:ip)
--host-rm list Remove a custom host-to-IP mapping (host:ip)
--hostname string Container hostname
--image string Service image tag
--init Use an init inside each service container to forward signals and reap processes
--isolation string Service container isolation mode
--label-add list Add or update a service label
--label-rm list Remove a label by its key
--limit-cpu decimal Limit CPUs
--limit-memory bytes Limit Memory
--log-driver string Logging driver for service
--log-opt list Logging driver options
--mount-add mount Add or update a mount on a service
--mount-rm list Remove a mount by its target path
--network-add network Add a network
--network-rm list Remove a network
--no-healthcheck Disable any container-specified HEALTHCHECK
--no-resolve-image Do not query the registry to resolve image digest and supported platforms
--placement-pref-add pref Add a placement preference
--placement-pref-rm pref Remove a placement preference
--publish-add port Add or update a published port
--publish-rm port Remove a published port by its target port
-q, --quiet Suppress progress output
--read-only Mount the container's root filesystem as read only
--replicas uint Number of tasks
--replicas-max-per-node uint Maximum number of tasks per node (default 0 = unlimited)
--reserve-cpu decimal Reserve CPUs
--reserve-memory bytes Reserve Memory
--restart-condition string Restart when condition is met ("none"|"on-failure"|"any")
--restart-delay duration Delay between restart attempts (ns|us|ms|s|m|h)
--restart-max-attempts uint Maximum number of restarts before giving up
--restart-window duration Window used to evaluate the restart policy (ns|us|ms|s|m|h)
--rollback Rollback to previous specification
--rollback-delay duration Delay between task rollbacks (ns|us|ms|s|m|h)
--rollback-failure-action string Action on rollback failure ("pause"|"continue")
--rollback-max-failure-ratio float Failure rate to tolerate during a rollback
--rollback-monitor duration Duration after each task rollback to monitor for failure (ns|us|ms|s|m|h)
--rollback-order string Rollback order ("start-first"|"stop-first")
--rollback-parallelism uint Maximum number of tasks rolled back simultaneously (0 to roll back all at once)
--secret-add secret Add or update a secret on a service
--secret-rm list Remove a secret
--stop-grace-period duration Time to wait before force killing a container (ns|us|ms|s|m|h)
--stop-signal string Signal to stop the container
--sysctl-add list Add or update a Sysctl option
--sysctl-rm list Remove a Sysctl option
-t, --tty Allocate a pseudo-TTY
--update-delay duration Delay between updates (ns|us|ms|s|m|h)
--update-failure-action string Action on update failure ("pause"|"continue"|"rollback")
--update-max-failure-ratio float Failure rate to tolerate during an update
--update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h)
--update-order string Update order ("start-first"|"stop-first")
--update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once)
-u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--with-registry-auth Send registry authentication details to swarm agents
-w, --workdir string Working directory inside the container
2.13帮助命令docker stack --help
命令明细[参数明细]:
Usage: docker stack [OPTIONS] COMMAND
Manage Docker stacks
Options:
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
Commands:
deploy Deploy a new stack or update an existing stack
ls List stacks
ps List the tasks in the stack
rm Remove one or more stacks
services List the services in the stack
Run 'docker stack COMMAND --help' for more information on a command.
2.13.1帮助命令docker stack deploy --help
命令明细[参数明细]:
Usage: docker stack deploy [OPTIONS] STACK
Deploy a new stack or update an existing stack
Aliases:
deploy, up
Options:
--bundle-file string Path to a Distributed Application Bundle file
-c, --compose-file strings Path to a Compose file, or "-" to read from stdin
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
--prune Prune services that are no longer referenced
--resolve-image string Query the registry to resolve image digest and supported platforms ("always"|"changed"|"never") (default "always")
--with-registry-auth Send registry authentication details to Swarm agents
2.13.2帮助命令docker stack ls --help
命令明细[参数明细]:
Usage: docker stack ls [OPTIONS]
List stacks
Aliases:
ls, list
Options:
--format string Pretty-print stacks using a Go template
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
2.13.3帮助命令docker stack ps --help
命令明细[参数明细]:
Usage: docker stack ps [OPTIONS] STACK
List the tasks in the stack
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print tasks using a Go template
--no-resolve Do not map IDs to Names
--no-trunc Do not truncate output
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
-q, --quiet Only display task IDs
2.13.4帮助命令docker stack rm --help
命令明细[参数明细]:
Usage: docker stack rm [OPTIONS] STACK [STACK...]
Remove one or more stacks
Aliases:
rm, remove, down
Options:
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
2.13.5帮助命令docker stack services --help
命令明细[参数明细]:
Usage: docker stack services [OPTIONS] STACK
List the services in the stack
Options:
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print services using a Go template
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
-q, --quiet Only display IDs
2.14帮助命令docker swarm --help
命令明细[参数明细]:
Usage: docker swarm COMMAND
Manage Swarm
Commands:
ca Display and rotate the root CA
init Initialize a swarm
join Join a swarm as a node and/or manager
join-token Manage join tokens
leave Leave the swarm
unlock Unlock swarm
unlock-key Manage the unlock key
update Update the swarm
Run 'docker swarm COMMAND --help' for more information on a command.
2.14.1帮助命令docker swarm ca --help
命令明细[参数明细]:
Usage: docker swarm ca [OPTIONS]
Display and rotate the root CA
Options:
--ca-cert pem-file Path to the PEM-formatted root CA certificate to use for the new cluster
--ca-key pem-file Path to the PEM-formatted root CA key to use for the new cluster
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s)
-d, --detach Exit immediately instead of waiting for the root rotation to converge
--external-ca external-ca Specifications of one or more certificate signing endpoints
-q, --quiet Suppress progress output
--rotate Rotate the swarm CA - if no certificate or key are provided, new ones will be generated
2.14.2帮助命令docker swarm init --help
命令明细[参数明细]:
Usage: docker swarm init [OPTIONS]
Initialize a swarm
Options:
--advertise-addr string Advertised address (format: <ip|interface>[:port])
--autolock Enable manager autolocking (requiring an unlock key to start a stopped manager)
--availability string Availability of the node ("active"|"pause"|"drain") (default "active")
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s)
--data-path-addr string Address or interface to use for data path traffic (format: <ip|interface>)
--data-path-port uint32 Port number to use for data path traffic (1024 - 49151). If no value is set or is set to 0, the default port
(4789) is used.
--default-addr-pool ipNetSlice default address pool in CIDR format (default [])
--default-addr-pool-mask-length uint32 default address pool subnet mask length (default 24)
--dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s)
--external-ca external-ca Specifications of one or more certificate signing endpoints
--force-new-cluster Force create a new cluster from current state
--listen-addr node-addr Listen address (format: <ip|interface>[:port]) (default 0.0.0.0:2377)
--max-snapshots uint Number of additional Raft snapshots to retain
--snapshot-interval uint Number of log entries between Raft snapshots (default 10000)
--task-history-limit int Task history retention limit (default 5)
2.14.3帮助命令docker swarm join --help
命令明细[参数明细]:
Usage: docker swarm join [OPTIONS] HOST:PORT
Join a swarm as a node and/or manager
Options:
--advertise-addr string Advertised address (format: <ip|interface>[:port])
--availability string Availability of the node ("active"|"pause"|"drain") (default "active")
--data-path-addr string Address or interface to use for data path traffic (format: <ip|interface>)
--listen-addr node-addr Listen address (format: <ip|interface>[:port]) (default 0.0.0.0:2377)
--token string Token for entry into the swarm
2.14.4帮助命令docker swarm join-token --help
命令明细[参数明细]:
Usage: docker swarm join-token [OPTIONS] (worker|manager)
Manage join tokens
Options:
-q, --quiet Only display token
--rotate Rotate join token
2.14.5帮助命令docker swarm leave --help
命令明细[参数明细]:
Usage: docker swarm leave [OPTIONS]
Leave the swarm
Options:
-f, --force Force this node to leave the swarm, ignoring warnings
2.14.6帮助命令docker swarm unlock --help
命令明细[参数明细]:
Usage: docker swarm unlock
Unlock swarm
2.14.7帮助命令docker swarm unlock-key --help
命令明细[参数明细]:
Usage: docker swarm unlock-key [OPTIONS]
Manage the unlock key
Options:
-q, --quiet Only display token
--rotate Rotate unlock key
2.14.8帮助命令docker swarm update --help
命令明细[参数明细]:
Usage: docker swarm update [OPTIONS]
Update the swarm
Options:
--autolock Change manager autolocking setting (true|false)
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s)
--dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s)
--external-ca external-ca Specifications of one or more certificate signing endpoints
--max-snapshots uint Number of additional Raft snapshots to retain
--snapshot-interval uint Number of log entries between Raft snapshots (default 10000)
--task-history-limit int Task history retention limit (default 5)
2.15帮助命令docker system --help
命令明细[参数明细]:
Usage: docker system COMMAND
Manage Docker
Commands:
df Show docker disk usage
events Get real time events from the server
info Display system-wide information
prune Remove unused data
Run 'docker system COMMAND --help' for more information on a command.
2.15.1帮助命令docker system df --help
命令明细[参数明细]:
Usage: docker system df [OPTIONS]
Show docker disk usage
Options:
--format string Pretty-print images using a Go template
-v, --verbose Show detailed information on space usage
2.15.2帮助命令docker system events --help
命令明细[参数明细]:
Usage: docker system events [OPTIONS]
Get real time events from the server
Options:
-f, --filter filter Filter output based on conditions provided
--format string Format the output using the given Go template
--since string Show all events created since timestamp
--until string Stream events until this timestamp
2.15.3帮助命令docker system info --help
命令明细[参数明细]:
Usage: docker system info [OPTIONS]
Display system-wide information
Options:
-f, --format string Format the output using the given Go template
2.15.4帮助命令docker system prune --help
命令明细[参数明细]:
Usage: docker system prune [OPTIONS]
Remove unused data
Options:
-a, --all Remove all unused images not just dangling ones
--filter filter Provide filter values (e.g. 'label=<key>=<value>')
-f, --force Do not prompt for confirmation
--volumes Prune volumes
2.16帮助命令docker trust --help
命令明细[参数明细]:
Usage: docker trust COMMAND
Manage trust on Docker images
Management Commands:
key Manage keys for signing Docker images
signer Manage entities who can sign Docker images
Commands:
inspect Return low-level information about keys and signatures
revoke Remove trust for an image
sign Sign an image
Run 'docker trust COMMAND --help' for more information on a command.
2.16.1帮助命令docker trust key --help
命令明细[参数明细]:
Usage: docker trust key COMMAND
Manage keys for signing Docker images
Commands:
generate Generate and load a signing key-pair
load Load a private key file for signing
Run 'docker trust key COMMAND --help' for more information on a command.
2.16.1.1帮助命令docker trust key generate --help
命令明细[参数明细]:
Usage: docker trust key generate NAME
Generate and load a signing key-pair
Options:
--dir string Directory to generate key in, defaults to current directory
2.16.1.2帮助命令docker trust key load --help
命令明细[参数明细]:
Usage: docker trust key load [OPTIONS] KEYFILE
Load a private key file for signing
Options:
--name string Name for the loaded key (default "signer")
2.16.2帮助命令docker trust signer --help
命令明细[参数明细]:
Usage: docker trust signer COMMAND
Manage entities who can sign Docker images
Commands:
add Add a signer
remove Remove a signer
Run 'docker trust signer COMMAND --help' for more information on a command.
2.16.2.1帮助命令docker trust signer add --help
命令明细[参数明细]:
Usage: docker trust signer add OPTIONS NAME REPOSITORY [REPOSITORY...]
Add a signer
Options:
--key list Path to the signer's public key file
2.16.2.2帮助命令docker trust signer remove --help
命令明细[参数明细]:
Usage: docker trust signer remove [OPTIONS] NAME REPOSITORY [REPOSITORY...]
Remove a signer
Options:
-f, --force Do not prompt for confirmation before removing the most recent signer
2.16.3帮助命令docker trust inspect --help
命令明细[参数明细]:
Usage: docker trust inspect IMAGE[:TAG] [IMAGE[:TAG]...]
Return low-level information about keys and signatures
Options:
--pretty Print the information in a human friendly format
2.16.4帮助命令docker trust revoke --help
命令明细[参数明细]:
Usage: docker trust revoke [OPTIONS] IMAGE[:TAG]
Remove trust for an image
Options:
-y, --yes Do not prompt for confirmation
2.16.5帮助命令docker trust sign --help
命令明细[参数明细]:
Usage: docker trust sign IMAGE:TAG
Sign an image
Options:
--local Sign a locally tagged image
2.17帮助命令docker volume --help
命令明细[参数明细]:
Usage: docker volume COMMAND
Manage volumes
Commands:
create Create a volume
inspect Display detailed information on one or more volumes
ls List volumes
prune Remove all unused local volumes
rm Remove one or more volumes
Run 'docker volume COMMAND --help' for more information on a command.
2.17.1帮助命令docker volume create --help
命令明细[参数明细]:
Usage: docker volume create [OPTIONS] [VOLUME]
Create a volume
Options:
-d, --driver string Specify volume driver name (default "local")
--label list Set metadata for a volume
-o, --opt map Set driver specific options (default map[])
2.17.2帮助命令docker volume inspect --help
命令明细[参数明细]:
Usage: docker volume inspect [OPTIONS] VOLUME [VOLUME...]
Display detailed information on one or more volumes
Options:
-f, --format string Format the output using the given Go template
2.17.3帮助命令docker volume ls --help
命令明细[参数明细]:
Usage: docker volume ls [OPTIONS]
List volumes
Aliases:
ls, list
Options:
-f, --filter filter Provide filter values (e.g. 'dangling=true')
--format string Pretty-print volumes using a Go template
-q, --quiet Only display volume names
2.17.4帮助命令docker volume prune --help
命令明细[参数明细]:
Usage: docker volume prune [OPTIONS]
Remove all unused local volumes
Options:
--filter filter Provide filter values (e.g. 'label=<label>')
-f, --force Do not prompt for confirmation
2.17.5帮助命令docker volume rm --help
命令明细[参数明细]:
Usage: docker volume rm [OPTIONS] VOLUME [VOLUME...]
Remove one or more volumes. You cannot remove a volume that is in use by a container.
Aliases:
rm, remove
Examples:
$ docker volume rm hello
hello
Options:
-f, --force Force the removal of one or more volumes
3.导出Docker命令明细脚本
导出Docker命令明细脚本,把每个命令详情生成到独立的指定文件中。
文件名:commandFile.sh
赋可执行权限:chmod a+x commandFile.sh
执行命令:./commandFile.sh
脚本内容:
#!/bin/bash
docker --help >> 1docker.txt
docker builder --help >> 2docker-builder.txt
docker builder build --help >> 2-1docker-builder-build.txt
docker builder prune --help >> 2-2docker-builder-prune.txt
docker config --help >> 3docker-config.txt
docker config create --help >> 3-1docker-config-create.txt
docker config inspect --help >> 3-2docker-config-inspect.txt
docker config ls --help >> 3-3docker-config-ls.txt
docker config rm --help >> 3-4docker-config-rm.txt
docker container --help >> 4docker-container.txt
docker container attach --help >> 4-1docker-container-attach.txt
docker container commit --help >> 4-2docker-container-commit.txt
docker container cp --help >> 4-3docker-container-cp.txt
docker container create --help >> 4-4docker-container-create.txt
docker container diff --help >> 4-5docker-container-diff.txt
docker container exec --help >> 4-6docker-container-exec.txt
docker container export --help >> 4-7docker-container-export.txt
docker container inspect --help >> 4-8docker-container-inspect.txt
docker container kill --help >> 4-9docker-container-kill.txt
docker container logs --help >> 4-10docker-container-logs.txt
docker container ls --help >> 4-11docker-container-ls.txt
docker container pause --help >> 4-12docker-container-pause.txt
docker container port --help >> 4-13docker-container-port.txt
docker container prune --help >> 4-14docker-container-prune.txt
docker container rename --help >> 4-15docker-container-rename.txt
docker container restart --help >> 4-16docker-container-restart.txt
docker container rm --help >> 4-17docker-container-rm.txt
docker container run --help >> 4-18docker-container-run.txt
docker container start --help >> 4-19docker-container-start.txt
docker container stats --help >> 4-20docker-container-stats.txt
docker container stop --help >> 4-21docker-container-stop.txt
docker container top --help >> 4-22docker-container-top.txt
docker container unpause --help >> 4-23docker-container-unpause.txt
docker container update --help >> 4-24docker-container-update.txt
docker container wait --help >> 4-25docker-container-wait.txt
docker context --help >> 5docker-context.txt
docker context create --help >> 5-1docker-context-create.txt
docker context export --help >> 5-2docker-context-export.txt
docker context import --help >> 5-3docker-context-import.txt
docker context inspect --help >> 5-4docker-context-inspect.txt
docker context ls --help >> 5-5docker-context-ls.txt
docker context rm --help >> 5-6docker-context-rm.txt
docker context update --help >> 5-7docker-context-update.txt
docker context use --help >> 5-8docker-context-use.txt
docker engine --help >> 6docker-engine.txt
docker engine activate --help >> 6-1docker-engine-activate.txt
docker engine check --help >> 6-2docker-engine-check.txt
docker engine update --help >> 6-3docker-engine-update.txt
docker image --help >> 7docker-image.txt
docker image build --help >> 7-1docker-image-build.txt
docker image history --help >> 7-2docker-image-history.txt
docker image import --help >> 7-3docker-image-import.txt
docker image inspect --help >> 7-4docker-image-inspect.txt
docker image load --help >> 7-5docker-image-load.txt
docker image ls --help >> 7-6docker-image-ls.txt
docker image prune --help >> 7-7docker-image-prune.txt
docker image pull --help >> 7-8docker-image-pull.txt
docker image push --help >> 7-9docker-image-push.txt
docker image rm --help >> 7-10docker-image-rm.txt
docker image save --help >> 7-11docker-image-save.txt
docker image tag --help >> 7-12docker-image-tag.txt
docker network --help >> 8docker-network.txt
docker network connect --help >> 8-1docker-network-connect.txt
docker network create --help >> 8-2docker-network-create.txt
docker network disconnect --help >> 8-3docker-network-disconnect.txt
docker network inspect --help >> 8-4docker-network-inspect.txt
docker network ls --help >> 8-5docker-network-ls.txt
docker network prune --help >> 8-6docker-network-prune.txt
docker network rm --help >> 8-7docker-network-rm.txt
docker node --help >> 9docker-node.txt
docker node demote --help >> 9-1docker-node-demote.txt
docker node promote --help >> 9-2docker-node-promote.txt
docker node ls --help >> 9-3docker-node-ls.txt
docker node promote --help >> 9-4docker-node-promote.txt
docker node ps --help >> 9-5docker-node-ps.txt
docker node rm --help >> 9-6docker-node-rm.txt
docker node update --help >> 9-7docker-node-update.txt
docker plugin --help >> 10docker-plugin.txt
docker plugin create --help >> 10-1docker-plugin-create.txt
docker plugin disable --help >> 10-2docker-plugin-disable.txt
docker plugin enable --help >> 10-3docker-plugin-enable.txt
docker plugin inspect --help >> 10-4docker-plugin-inspect.txt
docker plugin install --help >> 10-5docker-plugin-install.txt
docker plugin ls --help >> 10-6docker-plugin-ls.txt
docker plugin push --help >> 10-7docker-plugin-push.txt
docker plugin rm --help >> 10-8docker-plugin-rm.txt
docker plugin set --help >> 10-9docker-plugin-set.txt
docker plugin upgrade --help >> 10-10docker-plugin-upgrade.txt
docker secret --help >> 11docker-secret.txt
docker secret create --help >> 11-1docker-secret-create.txt
docker secret inspect --help >> 11-2docker-secret-inspect.txt
docker secret ls --help >> 11-3docker-secret-ls.txt
docker secret rm --help >> 11-4docker-secret-rm.txt
docker service --help >> 12docker-service.txt
docker service create --help >> 12-1docker-service-create.txt
docker service inspect --help >> 12-2docker-service-inspect.txt
docker service logs --help >> 12-3docker-service-logs.txt
docker service ls --help >> 12-4docker-service-ls.txt
docker service ps --help >> 12-5docker-service-ps.txt
docker service rm --help >> 12-6docker-service-rm.txt
docker service rollback --help >> 12-7docker-service-rollback.txt
docker service scale --help >> 12-8docker-service-scale.txt
docker service update --help >> 12-9docker-service-update.txt
docker stack --help >> 13docker-stack.txt
docker stack deploy --help >> 13-1docker-stack-deploy.txt
docker stack ls --help >> 13-2docker-stack-ls.txt
docker stack ps --help >> 13-3docker-stack-ps.txt
docker stack rm --help >> 13-4docker-stack-rm.txt
docker stack services --help >> 13-5docker-stack-services.txt
docker swarm --help >> 14docker-swarm.txt
docker swarm ca --help >> 14-1docker-swarm-ca.txt
docker swarm init --help >> 14-2docker-swarm-init.txt
docker swarm join --help >> 14-3docker-swarm-join.txt
docker swarm join-token --help >> 14-4docker-swarm-join-token.txt
docker swarm leave --help >> 14-5docker-swarm-leave.txt
docker swarm unlock --help >> 14-6docker-swarm-unlock.txt
docker swarm unlock-key --help >> 14-7docker-swarm-unlock-key.txt
docker swarm update --help >> 14-8docker-swarm-update.txt
docker system --help >> 15docker-system.txt
docker system df --help >> 15-1docker-system-df.txt
docker system events --help >> 15-2docker-system-events.txt
docker system info --help >> 15-3docker-system-info.txt
docker system prune --help >> 15-4docker-system-prune.txt
docker trust --help >> 16docker-trust.txt
docker trust key --help >>16-1docker-trust-key.txt
docker trust key generate --help >>16-1-1docker-trust-key-generate.txt
docker trust key load --help >>16-1-2docker-trust-key-load.txt
docker trust signer --help >>16-2docker-trust-signer.txt
docker trust signer add --help >>16-2-1docker-trust-signer-add.txt
docker trust signer remove --help >>16-2-2docker-trust-signer-remove.txt
docker trust inspect --help >>16-3docker-trust-inspect.txt
docker trust revoke --help >>16-4docker-trust-revoke.txt
docker trust sign --help >> 16-5docker-trust-sign.txt
docker volume --help >> 17docker-volume.txt
docker volume create --help >>17-1docker-volume-create.txt
docker volume inspect --help >>17-2docker-volume-inspect.txt
docker volume ls --help >>17-3docker-volume-ls.txt
docker volume prune --help >>17-4docker-volume-prune.txt
docker volume rm --help >> 17-5docker-volume-rm.txt
以上,感谢。
2022年12月27日
2392

被折叠的 条评论
为什么被折叠?



