Skip to content

Commit d3cb89e

Browse files
Merge pull request docker#2957 from thaJeztah/20.10_backport_docs_fixes
[20.10 backport] documentation and completion-script fixes
2 parents 433014b + 2b74b90 commit d3cb89e

File tree

7 files changed

+171
-15
lines changed

7 files changed

+171
-15
lines changed

contrib/completion/bash/docker

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ __docker_complete_log_options() {
935935
# awslogs does not implement the $common_options2.
936936
local awslogs_options="$common_options1 awslogs-create-group awslogs-credentials-endpoint awslogs-datetime-format awslogs-group awslogs-multiline-pattern awslogs-region awslogs-stream tag"
937937

938-
local fluentd_options="$common_options1 $common_options2 fluentd-address fluentd-async-connect fluentd-buffer-limit fluentd-retry-wait fluentd-max-retries fluentd-sub-second-precision tag"
938+
local fluentd_options="$common_options1 $common_options2 fluentd-address fluentd-async fluentd-buffer-limit fluentd-request-ack fluentd-retry-wait fluentd-max-retries fluentd-sub-second-precision tag"
939939
local gcplogs_options="$common_options1 $common_options2 gcp-log-cmd gcp-meta-id gcp-meta-name gcp-meta-zone gcp-project"
940940
local gelf_options="$common_options1 $common_options2 gelf-address gelf-compression-level gelf-compression-type gelf-tcp-max-reconnect gelf-tcp-reconnect-delay tag"
941941
local journald_options="$common_options1 $common_options2 tag"
@@ -1955,6 +1955,7 @@ _docker_container_run_and_create() {
19551955
--pid
19561956
--pids-limit
19571957
--publish -p
1958+
--pull
19581959
--restart
19591960
--runtime
19601961
--security-opt
@@ -2153,6 +2154,10 @@ _docker_container_run_and_create() {
21532154
esac
21542155
return
21552156
;;
2157+
--pull)
2158+
COMPREPLY=( $( compgen -W 'always missing never' -- "$cur" ) )
2159+
return
2160+
;;
21562161
--runtime)
21572162
__docker_complete_runtimes
21582163
return
@@ -2548,6 +2553,7 @@ _docker_daemon() {
25482553
--ip-forward=false
25492554
--ip-masq=false
25502555
--iptables=false
2556+
--ip6tables
25512557
--ipv6
25522558
--live-restore
25532559
--no-new-privileges
@@ -3601,7 +3607,7 @@ _docker_service_ls() {
36013607
return
36023608
;;
36033609
mode)
3604-
COMPREPLY=( $( compgen -W "global replicated" -- "${cur##*=}" ) )
3610+
COMPREPLY=( $( compgen -W "global global-job replicated replicated-job" -- "${cur##*=}" ) )
36053611
return
36063612
;;
36073613
name)
@@ -3731,6 +3737,7 @@ _docker_service_update_and_create() {
37313737
--limit-pids
37323738
--log-driver
37333739
--log-opt
3740+
--max-replicas
37343741
--replicas
37353742
--replicas-max-per-node
37363743
--reserve-cpu
@@ -3804,7 +3811,7 @@ _docker_service_update_and_create() {
38043811
return
38053812
;;
38063813
--mode)
3807-
COMPREPLY=( $( compgen -W "global replicated" -- "$cur" ) )
3814+
COMPREPLY=( $( compgen -W "global global-job replicated replicated-job" -- "$cur" ) )
38083815
return
38093816
;;
38103817
esac
@@ -4348,6 +4355,9 @@ _docker_node_ls() {
43484355
__docker_complete_nodes --cur "${cur##*=}" --id
43494356
return
43504357
;;
4358+
label|node.label)
4359+
return
4360+
;;
43514361
membership)
43524362
COMPREPLY=( $( compgen -W "accepted pending" -- "${cur##*=}" ) )
43534363
return
@@ -4364,7 +4374,7 @@ _docker_node_ls() {
43644374

43654375
case "$prev" in
43664376
--filter|-f)
4367-
COMPREPLY=( $( compgen -W "id label membership name role" -S = -- "$cur" ) )
4377+
COMPREPLY=( $( compgen -W "id label membership name node.label role" -S = -- "$cur" ) )
43684378
__docker_nospace
43694379
return
43704380
;;

contrib/completion/zsh/_docker

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ __docker_node_complete_ls_filters() {
13431343
;;
13441344
esac
13451345
else
1346-
opts=('id' 'label' 'membership' 'name' 'role')
1346+
opts=('id' 'label' 'membership' 'name' 'node.label' 'role')
13471347
_describe -t filter-opts "filter options" opts -qS "=" && ret=0
13481348
fi
13491349

@@ -2544,6 +2544,82 @@ __docker_volume_subcommand() {
25442544

25452545
# EO volume
25462546

2547+
# BO context
2548+
2549+
__docker_complete_contexts() {
2550+
[[ $PREFIX = -* ]] && return 1
2551+
integer ret=1
2552+
declare -a contexts
2553+
2554+
contexts=(${(f)${:-"$(_call_program commands docker $docker_options context ls -q)"$'\n'}})
2555+
2556+
_describe -t context-list "context" contexts && ret=0
2557+
return ret
2558+
}
2559+
2560+
__docker_context_commands() {
2561+
local -a _docker_context_subcommands
2562+
_docker_context_subcommands=(
2563+
"create:Create new context"
2564+
"inspect:Display detailed information on one or more contexts"
2565+
"list:List available contexts"
2566+
"rm:Remove one or more contexts"
2567+
"show:Print the current context"
2568+
"update:Update a context"
2569+
"use:Set the default context"
2570+
)
2571+
_describe -t docker-context-commands "docker context command" _docker_context_subcommands
2572+
}
2573+
2574+
__docker_context_subcommand() {
2575+
local -a _command_args opts_help
2576+
local expl help="--help"
2577+
integer ret=1
2578+
2579+
opts_help=("(: -)--help[Print usage]")
2580+
2581+
case "$words[1]" in
2582+
(create)
2583+
_arguments $(__docker_arguments) \
2584+
$opts_help \
2585+
"($help)--default-stack-orchestrator=[Default orchestrator for stack operations to use with this context]:default-stack-orchestrator:(swarm kubernetes all)" \
2586+
"($help)--description=[Description of the context]:description:" \
2587+
"($help)--docker=[Set the docker endpoint]:docker:" \
2588+
"($help)--kubernetes=[Set the kubernetes endpoint]:kubernetes:" \
2589+
"($help)--from=[Create context from a named context]:from:__docker_complete_contexts" \
2590+
"($help -):name: " && ret=0
2591+
;;
2592+
(use)
2593+
_arguments $(__docker_arguments) \
2594+
$opts_help \
2595+
"($help -)1:context:__docker_complete_contexts" && ret=0
2596+
;;
2597+
(inspect)
2598+
_arguments $(__docker_arguments) \
2599+
$opts_help \
2600+
"($help -)1:context:__docker_complete_contexts" && ret=0
2601+
;;
2602+
(rm)
2603+
_arguments $(__docker_arguments) \
2604+
$opts_help \
2605+
"($help -)1:context:__docker_complete_contexts" && ret=0
2606+
;;
2607+
(update)
2608+
_arguments $(__docker_arguments) \
2609+
$opts_help \
2610+
"($help)--default-stack-orchestrator=[Default orchestrator for stack operations to use with this context]:default-stack-orchestrator:(swarm kubernetes all)" \
2611+
"($help)--description=[Description of the context]:description:" \
2612+
"($help)--docker=[Set the docker endpoint]:docker:" \
2613+
"($help)--kubernetes=[Set the kubernetes endpoint]:kubernetes:" \
2614+
"($help -):name:" && ret=0
2615+
;;
2616+
esac
2617+
2618+
return ret
2619+
}
2620+
2621+
# EO context
2622+
25472623
__docker_caching_policy() {
25482624
oldp=( "$1"(Nmh+1) ) # 1 hour
25492625
(( $#oldp ))
@@ -2631,6 +2707,23 @@ __docker_subcommand() {
26312707
;;
26322708
esac
26332709
;;
2710+
(context)
2711+
local curcontext="$curcontext" state
2712+
_arguments $(__docker_arguments) \
2713+
$opts_help \
2714+
"($help -): :->command" \
2715+
"($help -)*:: :->option-or-argument" && ret=0
2716+
2717+
case $state in
2718+
(command)
2719+
__docker_context_commands && ret=0
2720+
;;
2721+
(option-or-argument)
2722+
curcontext=${curcontext%:*:*}:docker-${words[-1]}:
2723+
__docker_context_subcommand && ret=0
2724+
;;
2725+
esac
2726+
;;
26342727
(daemon)
26352728
_arguments $(__docker_arguments) \
26362729
$opts_help \

docs/deprecated.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Status | Feature
5252
-----------|------------------------------------------------------------------------------------------------------------------------------------|------------|------------
5353
Deprecated | [Pulling images from non-compliant image registries](#pulling-images-from-non-compliant-image-registries) | v20.10 | -
5454
Deprecated | [Linux containers on Windows (LCOW)](#linux-containers-on-windows-lcow-experimental) | v20.10 | -
55+
Deprecated | [BLKIO weight options with cgroups v1](#blkio-weight-options–with-cgroups-v1) | v20.10 | -
5556
Deprecated | [Kernel memory limit](#kernel-memory-limit) | v20.10 | -
5657
Deprecated | [Classic Swarm and overlay networks using external key/value stores](#classic-swarm-and-overlay-networks-using-cluster-store) | v20.10 | -
5758
Deprecated | [Support for the legacy `~/.dockercfg` configuration file for authentication](#support-for-legacy-dockercfg-configuration-files) | v20.10 | -
@@ -140,6 +141,16 @@ now stopped in favor of running docker natively on Linux in WSL2.
140141
Developers who want to run Linux workloads on a Windows host are encouraged to use
141142
[Docker Desktop with WSL2](https://docs.docker.com/docker-for-windows/wsl/) instead.
142143

144+
### BLKIO weight options with cgroups v1
145+
146+
**Deprecated in Release: v20.10**
147+
148+
Specifying blkio weight (`docker run --blkio-weight` and `docker run --blkio-weight-device`)
149+
is now marked as deprecated when using cgroups v1 because the corresponding features
150+
were [removed in Linux kernel v5.0 and up](https://github.com/torvalds/linux/commit/f382fb0bcef4c37dc049e9f6963e3baf204d815c).
151+
When using cgroups v2, the `--blkio-weight` options are implemented using
152+
[`io.weight](https://github.com/torvalds/linux/blob/v5.0/Documentation/admin-guide/cgroup-v2.rst#io).
153+
143154
### Kernel memory limit
144155

145156
**Deprecated in Release: v20.10**

docs/reference/commandline/node_ls.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ The currently supported filters are:
6060

6161
* [id](#id)
6262
* [label](#label)
63+
* [node.label](#nodelabel)
6364
* [membership](#membership)
6465
* [name](#name)
6566
* [role](#role)
@@ -77,7 +78,10 @@ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
7778

7879
#### label
7980

80-
The `label` filter matches nodes based on engine labels and on the presence of a `label` alone or a `label` and a value. Node labels are currently not used for filtering.
81+
The `label` filter matches nodes based on engine labels and on the presence of a
82+
`label` alone or a `label` and a value. Engine labels are configured in
83+
the [daemon configuration](dockerd.md#daemon-configuration-file). To filter on
84+
Swarm `node` labels, use [`node.label` instead](#nodelabel).
8185

8286
The following filter matches nodes with the `foo` label regardless of its value.
8387

@@ -88,6 +92,42 @@ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
8892
1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Ready Active
8993
```
9094

95+
#### node.label
96+
97+
The `node.label` filter matches nodes based on node labels and on the presence
98+
of a `node.label` alone or a `node.label` and a value.
99+
100+
The following filter updates nodes to have a `region` node label:
101+
102+
```console
103+
$ docker node update --label-add region=region-a swarm-test-01
104+
$ docker node update --label-add region=region-a swarm-test-02
105+
$ docker node update --label-add region=region-b swarm-test-03
106+
$ docker node update --label-add region=region-b swarm-test-04
107+
```
108+
109+
Show all nodes that have a `region` node label set:
110+
111+
```console
112+
$ docker node ls --filter node.label=region
113+
114+
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
115+
yg550ettvsjn6g6t840iaiwgb * swarm-test-01 Ready Active Leader 20.10.2
116+
2lm9w9kbepgvkzkkeyku40e65 swarm-test-02 Ready Active Reachable 20.10.2
117+
hc0pu7ntc7s4uvj4pv7z7pz15 swarm-test-03 Ready Active Reachable 20.10.2
118+
n41b2cijmhifxxvz56vwrs12q swarm-test-04 Ready Active 20.10.2
119+
```
120+
121+
Show all nodes that have a `region` node label, with value `region-a`:
122+
123+
```console
124+
$ docker node ls --filter node.label=region=region-a
125+
126+
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
127+
yg550ettvsjn6g6t840iaiwgb * swarm-test-01 Ready Active Leader 20.10.2
128+
2lm9w9kbepgvkzkkeyku40e65 swarm-test-02 Ready Active Reachable 20.10.2
129+
```
130+
91131
#### membership
92132

93133
The `membership` filter matches nodes based on the presence of a `membership` and a value

docs/reference/commandline/push.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ listed.
7676

7777
### Push all tags of an image
7878

79-
Use the `-a` (or `--all-tags`) option to push To push all tags of a local image.
79+
Use the `-a` (or `--all-tags`) option to push all tags of a local image.
8080

8181
The following example creates multiple tags for an image, and pushes all those
8282
tags to Docker Hub.

docs/reference/run.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
description: "Configure containers at runtime"
33
keywords: "docker, run, configure, runtime"
4+
redirect_from:
5+
- /reference/run/
46
---
57

68
<!-- This file is maintained within the docker/cli GitHub
@@ -1738,7 +1740,7 @@ volume mounted on the host).
17381740
17391741
The `container-dest` must always be an absolute path such as `/src/docs`.
17401742
The `host-src` can either be an absolute path or a `name` value. If you
1741-
supply an absolute path for the `host-dir`, Docker bind-mounts to the path
1743+
supply an absolute path for the `host-src`, Docker bind-mounts to the path
17421744
you specify. If you supply a `name`, Docker creates a named volume by that `name`.
17431745
17441746
A `name` value must start with an alphanumeric character,

man/docker-run.1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,13 @@ and foreground Docker containers.
504504
**--network**=*type*
505505
Set the Network mode for the container. Supported values are:
506506

507-
| Value | Description |
508-
|:----------------------------|:-----------------------------------------------------------------------------------------|
509-
| **none** | No networking in the container. |
510-
| **bridge** | Connect the container to the default Docker bridge via veth interfaces. |
511-
| **host** | Use the host's network stack inside the container. |
512-
| **container:**_name_|_id_ | Use the network stack of another container, specified via its _name_ or _id_. |
513-
| _network-name_|_network-id_ | Connects the container to a user created network (using `docker network create` command) |
507+
| Value | Description |
508+
|:-----------------------------|:-----------------------------------------------------------------------------------------|
509+
| **none** | No networking in the container. |
510+
| **bridge** | Connect the container to the default Docker bridge via veth interfaces. |
511+
| **host** | Use the host's network stack inside the container. |
512+
| **container:**_name_\|_id_ | Use the network stack of another container, specified via its _name_ or _id_. |
513+
| _network-name_\|_network-id_ | Connects the container to a user created network (using `docker network create` command) |
514514

515515
Default is **bridge**.
516516

0 commit comments

Comments
 (0)