常用命令归纳

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
container     管理容器
image 管理镜像
network 管理网络
node 管理Swarm节点
plugin 管理插件
secret 管理Docker secrets
service 管理服务
stack 管理Docker stacks
swarm 管理Swarm集群
system 查看系统信息
volume 管理卷

images 查看镜像列表
rmi 删除镜像
save 将指定镜像保存成 tar 归档文件
load 从存档或者STDIN加载镜像
build 从一个DockerFile构建镜像
commit 从容器创建一个镜像

create 创建一个容器
run 创建一个新的容器并运行一个命令
rename 重命名容器
start 启动容器
stop 停止容器
restart 重启容器
rm 删除容器
logs 获取一个容器的日志
exec 在正在运行的容器中运行命令
cp 从容器和主机文件系统之间拷贝文件
ps 查看容器列表

login 登陆docker镜像仓库
logout 退出docker镜像仓库
search 从Docker Hub搜索镜像
pull 从镜像仓库拉取镜像
push 将本地的镜像上传到镜像仓库,要先登陆到镜像仓库
tag 标记本地镜像,将其归入某一仓库
export 将容器的文件系统导出为tar存档
import 从归档文件中创建镜像

info 显示系统范围的信息
version 显示Docker的版本信息
stats 显示(实时)容器资源使用情况的统计信息
inspect 显示Docker对象的低级信息(查看对象详情)
diff 显示容器文件系统上的更改(查看容器变化)
events 显示从服务器获取实时事件(可查看docker的改动)
port 显示端口映射或容器的特定映射列表(端口查看)
top 显示一个容器中运行的进程(查看进程)
history 显示镜像的历史记录

attach 进入一个运行的容器
pause 暂停一个或多个容器中的所有进程
unpause 恢复容器中所有的进程
kill kill运行中的容器
wait 阻塞直到容器停止,然后打印退出代码

update 更新容器配置

镜像仓库相关

  • docker login: 登陆到一个Docker镜像仓库,如果未指定镜像仓库地址,默认为官方仓库Docker Hub
  • docker logout: 登出一个Docker镜像仓库,如果未指定镜像仓库地址,默认为官方仓库Docker Hub
  • docker pull: 从镜像仓库中拉取或者更新指定镜像;
  • docker push: 将本地的镜像上传到镜像仓库, 要先登陆到镜像仓库;
  • docker search: 从Docker Hub查找镜像;

登录镜像仓库

语法如下:

1
2
3
4
5
docker login [OPTIONS] [SERVER]

Options:
-p, --password string Password
-u, --username string Username

登出镜像仓库

语法如下:

1
docker logout [SERVER]

拉取镜像

语法如下:

1
2
3
4
5
docker pull [OPTIONS] NAME[:TAG|@DIGEST]

Options:
-a, --all-tags Download all tagged images in the repository(拉取所有tag)
--disable-content-trust Skip image verification (default true)(忽略校检,默认开启)

上传镜像

语法如下:

1
2
3
4
docker push [OPTIONS] NAME[:TAG]

Options:
--disable-content-trust Skip image verification (default true)

查找镜像

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
docker search [OPTIONS] TERM

OPTIONS
-f, --filter=[]
Filter output based on these conditions:
- stars=<numberOfStar>
- is-automated=(true|false)
- is-official=(true|false)

--limit=LIMIT
Maximum returned search results. The default is 25.

--no-trunc=true|false
Don't truncate output. The default is false.
-s 列出收藏数小于指定值的镜像。

例如:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@test ~]# docker search --limit=5 jdk
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/primetoninc/jdk Oracle jdk 1.8, 1.7 16 [OK]
docker.io docker.io/codenvy/jdk8_maven3_tomcat8 JDK 8, Maven 3, Tomcat 8 7 [OK]
docker.io docker.io/codenvy/jdk7_tomcat7 Dockerfile https://github.com/codenvy/dock... 6
docker.io docker.io/ascdc/jdk8 jdk8 3 [OK]
docker.io docker.io/ringcentral/jdk an alpine Linux image included glibc and O... 0
[root@test ~]# docker search -s 5 jdk
Flag --stars has been deprecated, use --filter=stars=3 instead
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/primetoninc/jdk Oracle jdk 1.8, 1.7 16 [OK]
docker.io docker.io/codenvy/jdk8_maven3_tomcat8 JDK 8, Maven 3, Tomcat 8 7 [OK]
docker.io docker.io/codenvy/jdk7_tomcat7 Dockerfile https://github.com/codenvy/dock... 6
docker.io docker.io/gmaslowski/jdk Oracle JDK8

本地镜像管理

  • docker images: 列出本地镜像;
  • docker rmi:删除本地镜像;
  • docker tag:标记本地镜像;
  • docker build:使用DockerFile创建镜像;
  • docker history:查看指定镜像的创建历史;
  • docker save:将指定镜像保存成tar归档文件;
  • docker load:导入使用docker save命令导出的镜像;
  • docker import:从归档文件中创建镜像;
  • docker commit:从容器修改中创建新的镜像;

列出本地镜像

语法如下:

1
2
3
4
5
6
7
8
9
10
11
docker images [OPTIONS] [REPOSITORY[:TAG]]

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
--help Print usage
--no-trunc Don't truncate output(显示完整的镜像信息)
-q, --quiet Only show numeric IDs

删除本地镜像

语法如下:

1
2
3
4
5
docker rmi [OPTIONS] IMAGE [IMAGE...]

Options:
-f, --force Force removal of the image(强制删除镜像)
--no-prune Do not delete untagged parents(不移除该镜像的过程镜像,默认移除)

例如:

1
2
3
4
5
# 删除所有镜像
docker rmi $(docker images -q) 

# 批量删除无用镜像
docker rmi $(docker images -f dangling=true)

标记本地镜像

语法如下:

1
docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

使用DockerFile创建镜像

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
docker build [OPTIONS] PATH | URL | -

Options:
--build-arg list Set build-time variables (default [])
--cache-from stringSlice 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
--help Print usage
--isolation string Container isolation technology
--label list Set metadata for an image (default [])
-m, --memory string Memory limit
--memory-swap string 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
--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)
--security-opt stringSlice Security options
--shm-size string Size of /dev/shm, default value is 64MB
-t, --tag list Name and optionally a tag in the 'name:tag' format (default [])
--ulimit ulimit Ulimit options (default [])

查看指定镜像的创建历史

语法如下:

1
2
3
4
5
6
docker history [OPTIONS] IMAGE

Options:
-H, --human Print sizes and dates in human readable format (default true)
--no-trunc Don't truncate output
-q, --quiet Only show numeric IDs

镜像保存

语法如下:

1
2
3
4
docker save [OPTIONS] IMAGE [IMAGE...]

Options:
-o, --output string Write to a file, instead of STDOUT

镜像导入

语法如下:

1
2
3
4
5
docker load [OPTIONS]

Options:
-i, --input string Read from tar archive file, instead of STDIN
-q, --quiet Suppress the load output

从归档文件中创建镜像

语法如下:

1
2
3
4
5
6
docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]

Options:
-c, --change list Apply Dockerfile instruction to the created image (default [])
-m, --message string Set commit message for imported image

从容器修改中创建新镜像

语法如下:

1
2
3
4
5
6
7
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Options:
-a, --author string Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
-c, --change list Apply Dockerfile instruction to the created image (default [])
-m, --message string Commit message
-p, --pause Pause container during commit (default true)

容器操作

  • docker ps:列出容器;
  • docker inspect:获取容器/镜像的元数据;
  • docker top:查看容器中运行的进程信息;
  • docker events:从服务器获取实时事件;
  • docker logs:获取容器的日志;
  • docker wait:阻塞运行直到容器停止,然后打印出它的退出代码;
  • docker export:将文件系统作为一个tar归档文件导出到STDOUT;
  • docker port:列出指定的容器的端口映射,或者查找将PRIVATE_PORT NAT到面向公众的端口;
  • docker stats:显示容器资源使用情况统计信息的实时流;

列出容器

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
docker ps [OPTIONS]

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
--help Print usage
-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

获取容器/镜像的元数据

语法如下:

1
2
3
4
5
6
7
docker inspect [OPTIONS] NAME|ID [NAME|ID...]

Options:
-f, --format string Format the output using the given Go template
--help Print usage
-s, --size Display total file sizes if the type is container
--type string Return JSON for specified type

查看容器中运行的进程信息

语法如下:

1
docker top CONTAINER [ps OPTIONS]

获取事件

语法如下:

1
2
3
4
5
6
7
docker events [OPTIONS]

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

获取日志

语法如下:

1
2
3
4
5
6
7
8
docker logs [OPTIONS] CONTAINER

Options:
--details Show extra details provided to logs
-f, --follow Follow log output
--since string Show logs since timestamp
--tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps

阻塞运行

语法如下:

1
docker wait CONTAINER [CONTAINER...]

导出容器

语法如下:

1
2
3
4
docker export [OPTIONS] CONTAINER

Options:
-o, --output string Write to a file, instead of STDOUT

端口映射

语法如下:

1
docker port CONTAINER [PRIVATE_PORT[/PROTO]]

显示资源使用

语法如下:

1
2
3
4
5
6
docker stats [OPTIONS] [CONTAINER...]

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

容器生命周期管理

  • docker run:创建一个新的容器并运行一个命令;
  • docker start/stop/restart:启停容器;
  • docker kill:杀掉运行中的容器;
  • docker rm:删除一个或多个容器;
  • docker pause/unpause:暂停或恢复容器中的所有进程;
  • docker create:创建一个新的容器但不启动它;
  • docker exec:在运行的容器中执行命令;
  • docker update:更新一个或多个容器的配置;

运行容器

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Options:
--add-host list Add a custom host-to-IP mapping (host:ip) (default [])
-a, --attach list Attach to STDIN, STDOUT or STDERR (default [])
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
--blkio-weight-device weighted-device Block IO weight (relative device weight) (default [])
--cap-add list Add Linux capabilities (default [])
--cap-drop list Drop Linux capabilities (default [])
--cgroup-parent string Optional parent cgroup for the container
--cidfile string Write the container ID to the file
--cpu-count int CPU count (Windows only)
--cpu-percent int CPU percent (Windows only)
--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 (default 0.000)
--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)
--credentialspec string Credential spec for managed service account (Windows only)
-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 (default [])
--device-read-bps throttled-device Limit read rate (bytes per second) from a device (default [])
--device-read-iops throttled-device Limit read rate (IO per second) from a device (default [])
--device-write-bps throttled-device Limit write rate (bytes per second) to a device (default [])
--device-write-iops throttled-device Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true)
--dns list Set custom DNS servers (default [])
--dns-option list Set DNS options (default [])
--dns-search list Set custom DNS search domains (default [])
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env list Set environment variables (default [])
--env-file list Read in a file of environment variables (default [])
--expose list Expose a port or a range of ports (default [])
--group-add list Add additional groups to join (default [])
--health-cmd string Command to run to check health
--health-interval duration Time between running the check (ns|us|ms|s|m|h) (default 0s)
--health-retries int Consecutive failures needed to report unhealthy
--health-timeout duration Maximum time to allow one check to run (ns|us|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
--init-path string Path to the docker-init binary
-i, --interactive Keep STDIN open even if not attached
--io-maxbandwidth string Maximum IO bandwidth limit for the system drive (Windows only)
--io-maxiops uint Maximum IOps limit for the system drive (Windows only)
--ip string Container IPv4 address (e.g. 172.30.100.104)
--ip6 string Container IPv6 address (e.g. 2001:db8::33)
--ipc string IPC namespace to use
--isolation string Container isolation technology
--kernel-memory string Kernel memory limit
-l, --label list Set meta data on a container (default [])
--label-file list Read in a line delimited file of labels (default [])
--link list Add link to another container (default [])
--link-local-ip list Container IPv4/IPv6 link-local addresses (default [])
--log-driver string Logging driver for the container
--log-opt list Log driver options (default [])
--mac-address string Container MAC address (e.g. 92:d0:c6:0a:29:33)
-m, --memory string Memory limit
--memory-reservation string Memory soft limit
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--memory-swappiness int Tune container memory swappiness (0 to 100) (default -1)
--name string Assign a name to the container
--network string Connect a container to a network (default "default")
--network-alias list Add network-scoped alias for the container (default [])
--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)
--privileged Give extended privileges to this container
-p, --publish list Publish a container's port(s) to the host (default [])
-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 (default [])
--shm-size string Size of /dev/shm, default value is 64MB
--sig-proxy Proxy received signals to the process (default true)
--stop-signal string Signal to stop a container, SIGTERM by default (default "SIGTERM")
--stop-timeout int Timeout (in seconds) to stop a container
--storage-opt list Storage driver options for the container (default [])
--sysctl map Sysctl options (default map[])
--tmpfs list Mount a tmpfs directory (default [])
-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 (default [])
--volume-driver string Optional volume driver for the container
--volumes-from list Mount volumes from the specified container(s) (default [])
-w, --workdir string Working directory inside the container

例子:

1
2
# 使用镜像nginx:latest,以后台模式启动一个容器,将容器的80端口映射到主机的80端口,主机的目录/data映射到容器的/data
docker run -p 80:80 -v /data:/data -d nginx:latest

启停容器

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 启动已经被停止的容器
docker start [OPTIONS] CONTAINER [CONTAINER...]

Options:
-a, --attach Attach STDOUT/STDERR and forward signals
--detach-keys string Override the key sequence for detaching a container
-i, --interactive Attach container's STDIN

# 停止运行中的容器
docker stop [OPTIONS] CONTAINER [CONTAINER...]

Options:
-t, --time int Seconds to wait for stop before killing it (default 10)

# 重启容器
docker restart [OPTIONS] CONTAINER [CONTAINER...]

Options:
-t, --time int Seconds to wait for stop before killing the container (default 10)

杀掉容器

语法如下:

1
2
3
4
docker kill [OPTIONS] CONTAINER [CONTAINER...]

Options:
-s, --signal string Signal to send to the container (default "KILL")

删除容器

语法如下:

1
2
3
4
5
6
docker rm [OPTIONS] CONTAINER [CONTAINER...]

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

暂停或恢复容器中所有的进程

语法如下:

1
2
3
4
5
# 暂停容器中所有的进程
docker pause CONTAINER [CONTAINER...]

# 恢复容器中所有的进程
docker unpause CONTAINER [CONTAINER...]

创建一个新的容器但不启动它

语法同docker run

在容器中执行命令

语法如下:

1
2
3
4
5
6
7
8
9
10
11
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

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 (default [])
--help Print usage
-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>])

更新一个或多个容器的配置

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
docker update [OPTIONS] CONTAINER [CONTAINER...]

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)
--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)
--help Print usage
--kernel-memory string Kernel memory limit
-m, --memory string Memory limit
--memory-reservation string Memory soft limit
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--restart string Restart policy to apply when a container exits

容器rootfs命令

  • docker commit:从容器创建一个新的镜像;
  • docker cp:用于容器与主机之间的数据拷贝;
  • docker diff:检查容器文件系统上文件或目录的更改;
  • docker rename:重命名一个容器;

从容器创建一个新的镜像

语法如下:

1
2
3
4
5
6
7
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Options:
-a, --author string Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
-c, --change list Apply Dockerfile instruction to the created image (default [])
-m, --message string Commit message
-p, --pause Pause container during commit (default true)

数据拷贝

语法如下:

1
2
3
4
5
docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Options:
-L, --follow-link Always follow symbol link in SRC_PATH

检查文件或目录的更改

语法如下:

1
docker diff CONTAINER

重命名

语法如下:

1
docker rename CONTAINER NEW_NAME

管理命令

  • docker network:管理网络;
  • docker container:管理容器;
  • docker service:管理服务;
  • docker node:管理Swarm节点;
  • docker plugin:管理插件;
  • docker stack:管理堆栈;
  • docker system:管理系统信息;
  • docker swarm:管理Swarm集群;
  • docker volume:管理卷;

管理网络

语法如下:

1
2
3
4
5
6
7
8
9
10
docker network COMMAND

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

管理容器

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
docker container COMMAND

Commands:
attach Attach 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

管理服务

语法如下:

1
2
3
4
5
6
7
8
9
10
docker service COMMAND

Commands:
create Create a new service
inspect Display detailed information on one or more services
ls List services
ps List the tasks of a service
rm Remove one or more services
scale Scale one or multiple replicated services
update Update a service

管理节点

语法如下:

1
2
3
4
5
6
7
8
9
10
docker node COMMAND

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

管理插件

语法如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
docker plugin COMMAND

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