diff options
author | Yong Tang <yong.tang.github@outlook.com> | 2016-11-08 18:29:10 -0800 |
---|---|---|
committer | Yong Tang <yong.tang.github@outlook.com> | 2016-11-09 12:13:25 -0800 |
commit | 9b6b3c2076911ea0a510548943180ac9d1b8c286 (patch) | |
tree | 6750f4498a1281f537d90fba45fcfc94bab594fb /runconfig/opts | |
parent | f67d4b897adc9048269d1b91435b6dcbf69e36d1 (diff) | |
download | docker-9b6b3c2076911ea0a510548943180ac9d1b8c286.tar.gz |
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>
Diffstat (limited to 'runconfig/opts')
-rw-r--r-- | runconfig/opts/parse.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runconfig/opts/parse.go b/runconfig/opts/parse.go index a1a2649fdd..eaea507f36 100644 --- a/runconfig/opts/parse.go +++ b/runconfig/opts/parse.go @@ -187,7 +187,11 @@ func AddFlags(flags *pflag.FlagSet) *ContainerOptions { // Network and port publishing flag flags.Var(&copts.extraHosts, "add-host", "Add a custom host-to-IP mapping (host:ip)") flags.Var(&copts.dns, "dns", "Set custom DNS servers") + // We allow for both "--dns-opt" and "--dns-option", although the latter is the recommended way. + // This is to be consistent with service create/update flags.Var(&copts.dnsOptions, "dns-opt", "Set DNS options") + flags.Var(&copts.dnsOptions, "dns-option", "Set DNS options") + flags.MarkHidden("dns-opt") flags.Var(&copts.dnsSearch, "dns-search", "Set custom DNS search domains") flags.Var(&copts.expose, "expose", "Expose a port or a range of ports") flags.StringVar(&copts.ipv4Address, "ip", "", "Container IPv4 address (e.g. 172.30.100.104)") |