Skip to content

Commit

Permalink
Add --dns-option to docker run and hide --dns-opt
Browse files Browse the repository at this point in the history
This fix is a follow up to #27567 based on:
moby/moby#27567 (comment)

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 <[email protected]>
  • Loading branch information
yongtang authored and Tibor Vass committed Jun 2, 2017
1 parent bf622ed commit ebacbb5
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ _docker_container_run() {
--device-write-bps
--device-write-iops
--dns
--dns-opt
--dns-option
--dns-search
--entrypoint
--env -e
Expand Down
2 changes: 1 addition & 1 deletion contrib/completion/zsh/_docker
Original file line number Diff line number Diff line change
Expand Up @@ -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)--disable-content-trust[Skip image verification]"
"($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)*"{-e=,--env=}"[Environment variables]:environment variable: "
"($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: "
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/commandline/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Options:
--device-write-iops value Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true)
--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 [])
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env value Set environment variables (default [])
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/commandline/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Options:
--device-write-iops value Limit write rate (IO per second) to a device (default [])
--disable-content-trust Skip image verification (default true)
--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 [])
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env value Set environment variables (default [])
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/commandline/service_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Options:
--constraint list Placement constraints (default [])
--container-label list Container labels (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 [])
--endpoint-mode string Endpoint mode (vip or dnsrr)
-e, --env list Set environment variables (default [])
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/commandline/service_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Options:
--constraint-rm list Remove a constraint (default [])
--container-label-add list Add or update a container label (default [])
--container-label-rm list Remove a container label by its key (default [])
--dns-add list Add or update custom DNS servers (default [])
--dns-options-add list Add or update DNS options (default [])
--dns-options-rm list Remove DNS options (default [])
--dns-rm list Remove custom DNS servers (default [])
--dns-search-add list Add or update custom DNS search domains (default [])
--dns-search-rm list Remove DNS search domains (default [])
--dns-add list Add or update a custom DNS server (default [])
--dns-option-add list Add or update a DNS option (default [])
--dns-option-rm list Remove a DNS option (default [])
--dns-rm list Remove a custom DNS server (default [])
--dns-search-add list Add or update a custom DNS search domain (default [])
--dns-search-rm list Remove a DNS search domain (default [])
--endpoint-mode string Endpoint mode (vip or dnsrr)
--env-add list Add or update an environment variable (default [])
--env-rm list Remove an environment variable (default [])
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 inside the container.
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` and `/etc/resolv.conf` on the host.

Expand All @@ -407,7 +407,7 @@ or a High Performance Web Server.
With the network set to `container` a container will share the
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`
`--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
also invalid in `container` netmode.

Expand Down
4 changes: 2 additions & 2 deletions man/docker-create.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ docker-create - Create a new container
[**--device-write-iops**[=*[]*]]
[**--dns**[=*[]*]]
[**--dns-search**[=*[]*]]
[**--dns-opt**[=*[]*]]
[**--dns-option**[=*[]*]]
[**-e**|**--env**[=*[]*]]
[**--entrypoint**[=*ENTRYPOINT*]]
[**--env-file**[=*[]*]]
Expand Down Expand Up @@ -190,7 +190,7 @@ two memory nodes.
**--dns**=[]
Set custom DNS servers

**--dns-opt**=[]
**--dns-option**=[]
Set custom DNS options

**--dns-search**=[]
Expand Down
4 changes: 2 additions & 2 deletions man/docker-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docker-run - Run a command in a new container
[**--device-write-bps**[=*[]*]]
[**--device-write-iops**[=*[]*]]
[**--dns**[=*[]*]]
[**--dns-opt**[=*[]*]]
[**--dns-option**[=*[]*]]
[**--dns-search**[=*[]*]]
[**-e**|**--env**[=*[]*]]
[**--entrypoint**[=*ENTRYPOINT*]]
Expand Down Expand Up @@ -260,7 +260,7 @@ See **config-json(5)** for documentation on using a configuration file.
**--dns-search**=[]
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

**--dns**=[]
Expand Down

0 comments on commit ebacbb5

Please sign in to comment.