Add `--dns-option` to `docker run` and hide `--dns-opt`

This fix is a follow up to #27567 based on:
https://github.com/docker/docker/pull/27567#issuecomment-259295055

In #27567, `--dns-options` has been added to `service create/update`,
together with `--dns` and `--dns-search`. The `--dns-opt` was used
in `docker run`.

This fix add `--dns-option` (not `--dns-options`) to `docker run/create`, and hide
`--dns-opt`. It is still possible to use `--dns-opt` with
`docker run/create`, though it will not show up in help output.

This fix change `--dns-options`to --dns-option` for `docker service create`
and `docker service update`.

This fix also updates the docs and bash/zsh completion scripts.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2016-11-08 18:29:10 -08:00 committed by Tibor Vass
parent bf622eddc1
commit ebacbb50ae
9 changed files with 17 additions and 17 deletions

View File

@ -1248,7 +1248,7 @@ _docker_container_run() {
--device-write-bps --device-write-bps
--device-write-iops --device-write-iops
--dns --dns
--dns-opt --dns-option
--dns-search --dns-search
--entrypoint --entrypoint
--env -e --env -e

View File

@ -531,7 +531,7 @@ __docker_container_subcommand() {
"($help)*--device-write-iops=[Limit the write rate (IO per second) to a device]:device:IO rate: " "($help)*--device-write-iops=[Limit the write rate (IO per second) to a device]:device:IO rate: "
"($help)--disable-content-trust[Skip image verification]" "($help)--disable-content-trust[Skip image verification]"
"($help)*--dns=[Custom DNS servers]:DNS server: " "($help)*--dns=[Custom DNS servers]:DNS server: "
"($help)*--dns-opt=[Custom DNS options]:DNS option: " "($help)*--dns-option=[Custom DNS options]:DNS option: "
"($help)*--dns-search=[Custom DNS search domains]:DNS domains: " "($help)*--dns-search=[Custom DNS search domains]:DNS domains: "
"($help)*"{-e=,--env=}"[Environment variables]:environment variable: " "($help)*"{-e=,--env=}"[Environment variables]:environment variable: "
"($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: " "($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: "

View File

@ -50,7 +50,7 @@ Options:
--device-write-iops value Limit write rate (IO per second) to a device (default []) --device-write-iops value Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true) --disable-content-trust Skip image verification (default true)
--dns value Set custom DNS servers (default []) --dns value Set custom DNS servers (default [])
--dns-opt value Set DNS options (default []) --dns-option value Set DNS options (default [])
--dns-search value Set custom DNS search domains (default []) --dns-search value Set custom DNS search domains (default [])
--entrypoint string Overwrite the default ENTRYPOINT of the image --entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env value Set environment variables (default []) -e, --env value Set environment variables (default [])

View File

@ -54,7 +54,7 @@ Options:
--device-write-iops value Limit write rate (IO per second) to a device (default []) --device-write-iops value Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true) --disable-content-trust Skip image verification (default true)
--dns value Set custom DNS servers (default []) --dns value Set custom DNS servers (default [])
--dns-opt value Set DNS options (default []) --dns-option value Set DNS options (default [])
--dns-search value Set custom DNS search domains (default []) --dns-search value Set custom DNS search domains (default [])
--entrypoint string Overwrite the default ENTRYPOINT of the image --entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env value Set environment variables (default []) -e, --env value Set environment variables (default [])

View File

@ -24,7 +24,7 @@ Options:
--constraint list Placement constraints (default []) --constraint list Placement constraints (default [])
--container-label list Container labels (default []) --container-label list Container labels (default [])
--dns list Set custom DNS servers (default []) --dns list Set custom DNS servers (default [])
--dns-options list Set DNS options (default []) --dns-option list Set DNS options (default [])
--dns-search list Set custom DNS search domains (default []) --dns-search list Set custom DNS search domains (default [])
--endpoint-mode string Endpoint mode (vip or dnsrr) --endpoint-mode string Endpoint mode (vip or dnsrr)
-e, --env list Set environment variables (default []) -e, --env list Set environment variables (default [])

View File

@ -26,12 +26,12 @@ Options:
--constraint-rm list Remove a constraint (default []) --constraint-rm list Remove a constraint (default [])
--container-label-add list Add or update a container label (default []) --container-label-add list Add or update a container label (default [])
--container-label-rm list Remove a container label by its key (default []) --container-label-rm list Remove a container label by its key (default [])
--dns-add list Add or update custom DNS servers (default []) --dns-add list Add or update a custom DNS server (default [])
--dns-options-add list Add or update DNS options (default []) --dns-option-add list Add or update a DNS option (default [])
--dns-options-rm list Remove DNS options (default []) --dns-option-rm list Remove a DNS option (default [])
--dns-rm list Remove custom DNS servers (default []) --dns-rm list Remove a custom DNS server (default [])
--dns-search-add list Add or update custom DNS search domains (default []) --dns-search-add list Add or update a custom DNS search domain (default [])
--dns-search-rm list Remove DNS search domains (default []) --dns-search-rm list Remove a DNS search domain (default [])
--endpoint-mode string Endpoint mode (vip or dnsrr) --endpoint-mode string Endpoint mode (vip or dnsrr)
--env-add list Add or update an environment variable (default []) --env-add list Add or update an environment variable (default [])
--env-rm list Remove an environment variable (default []) --env-rm list Remove an environment variable (default [])

View File

@ -388,7 +388,7 @@ network mode a container has its own UTS namespace by default. As such
`--hostname` is allowed in `host` network mode and will only change the `--hostname` is allowed in `host` network mode and will only change the
hostname inside the container. hostname inside the container.
Similar to `--hostname`, the `--add-host`, `--dns`, `--dns-search`, and Similar to `--hostname`, the `--add-host`, `--dns`, `--dns-search`, and
`--dns-opt` options can be used in `host` network mode. These options update `--dns-option` options can be used in `host` network mode. These options update
`/etc/hosts` or `/etc/resolv.conf` inside the container. No change are made to `/etc/hosts` or `/etc/resolv.conf` inside the container. No change are made to
`/etc/hosts` and `/etc/resolv.conf` on the host. `/etc/hosts` and `/etc/resolv.conf` on the host.
@ -407,7 +407,7 @@ or a High Performance Web Server.
With the network set to `container` a container will share the With the network set to `container` a container will share the
network stack of another container. The other container's name must be network stack of another container. The other container's name must be
provided in the format of `--network container:<name|id>`. Note that `--add-host` provided in the format of `--network container:<name|id>`. Note that `--add-host`
`--hostname` `--dns` `--dns-search` `--dns-opt` and `--mac-address` are `--hostname` `--dns` `--dns-search` `--dns-option` and `--mac-address` are
invalid in `container` netmode, and `--publish` `--publish-all` `--expose` are invalid in `container` netmode, and `--publish` `--publish-all` `--expose` are
also invalid in `container` netmode. also invalid in `container` netmode.

View File

@ -31,7 +31,7 @@ docker-create - Create a new container
[**--device-write-iops**[=*[]*]] [**--device-write-iops**[=*[]*]]
[**--dns**[=*[]*]] [**--dns**[=*[]*]]
[**--dns-search**[=*[]*]] [**--dns-search**[=*[]*]]
[**--dns-opt**[=*[]*]] [**--dns-option**[=*[]*]]
[**-e**|**--env**[=*[]*]] [**-e**|**--env**[=*[]*]]
[**--entrypoint**[=*ENTRYPOINT*]] [**--entrypoint**[=*ENTRYPOINT*]]
[**--env-file**[=*[]*]] [**--env-file**[=*[]*]]
@ -190,7 +190,7 @@ two memory nodes.
**--dns**=[] **--dns**=[]
Set custom DNS servers Set custom DNS servers
**--dns-opt**=[] **--dns-option**=[]
Set custom DNS options Set custom DNS options
**--dns-search**=[] **--dns-search**=[]

View File

@ -32,7 +32,7 @@ docker-run - Run a command in a new container
[**--device-write-bps**[=*[]*]] [**--device-write-bps**[=*[]*]]
[**--device-write-iops**[=*[]*]] [**--device-write-iops**[=*[]*]]
[**--dns**[=*[]*]] [**--dns**[=*[]*]]
[**--dns-opt**[=*[]*]] [**--dns-option**[=*[]*]]
[**--dns-search**[=*[]*]] [**--dns-search**[=*[]*]]
[**-e**|**--env**[=*[]*]] [**-e**|**--env**[=*[]*]]
[**--entrypoint**[=*ENTRYPOINT*]] [**--entrypoint**[=*ENTRYPOINT*]]
@ -260,7 +260,7 @@ See **config-json(5)** for documentation on using a configuration file.
**--dns-search**=[] **--dns-search**=[]
Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain) Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)
**--dns-opt**=[] **--dns-option**=[]
Set custom DNS options Set custom DNS options
**--dns**=[] **--dns**=[]