Add support for DNS options

Signed-off-by: Tim Hockin <thockin@google.com>
This commit is contained in:
Tim Hockin 2015-08-31 11:47:25 -07:00 committed by Tibor Vass
parent f5eb62c180
commit 8bdf17d8fe
11 changed files with 30 additions and 8 deletions

View File

@ -533,6 +533,7 @@ _docker_daemon() {
--default-ulimit --default-ulimit
--dns --dns
--dns-search --dns-search
--dns-opt
--exec-driver -e --exec-driver -e
--exec-opt --exec-opt
--exec-root --exec-root
@ -1124,6 +1125,7 @@ _docker_run() {
--cpu-shares -c --cpu-shares -c
--device --device
--dns --dns
--dns-opt
--dns-search --dns-search
--entrypoint --entrypoint
--env -e --env -e

View File

@ -49,6 +49,7 @@ complete -c docker -f -n '__fish_docker_no_subcommand' -l bip -d "Use this CIDR
complete -c docker -f -n '__fish_docker_no_subcommand' -s D -l debug -d 'Enable debug mode' complete -c docker -f -n '__fish_docker_no_subcommand' -s D -l debug -d 'Enable debug mode'
complete -c docker -f -n '__fish_docker_no_subcommand' -s d -l daemon -d 'Enable daemon mode' complete -c docker -f -n '__fish_docker_no_subcommand' -s d -l daemon -d 'Enable daemon mode'
complete -c docker -f -n '__fish_docker_no_subcommand' -l dns -d 'Force Docker to use specific DNS servers' complete -c docker -f -n '__fish_docker_no_subcommand' -l dns -d 'Force Docker to use specific DNS servers'
complete -c docker -f -n '__fish_docker_no_subcommand' -l dns-opt -d 'Force Docker to use specific DNS options'
complete -c docker -f -n '__fish_docker_no_subcommand' -l dns-search -d 'Force Docker to use specific DNS search domains' complete -c docker -f -n '__fish_docker_no_subcommand' -l dns-search -d 'Force Docker to use specific DNS search domains'
complete -c docker -f -n '__fish_docker_no_subcommand' -s e -l exec-driver -d 'Force the Docker runtime to use a specific exec driver' complete -c docker -f -n '__fish_docker_no_subcommand' -s e -l exec-driver -d 'Force the Docker runtime to use a specific exec driver'
complete -c docker -f -n '__fish_docker_no_subcommand' -l exec-opt -d 'Set exec driver options' complete -c docker -f -n '__fish_docker_no_subcommand' -l exec-opt -d 'Set exec driver options'
@ -122,6 +123,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cidfile -d '
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpuset -d 'CPUs in which to allow execution (0-3, 0,1)' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l cpuset -d 'CPUs in which to allow execution (0-3, 0,1)'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns -d 'Set custom DNS servers' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns -d 'Set custom DNS servers'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns-opt -d "Set custom DNS options (Use --dns-opt='' if you don't wish to set options)"
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns-search -d "Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)" complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l dns-search -d "Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)"
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s e -l env -d 'Set environment variables' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -s e -l env -d 'Set environment variables'
complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image' complete -c docker -A -f -n '__fish_seen_subcommand_from create' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image'
@ -309,6 +311,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l cpuset -d 'CPUs
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s d -l detach -d 'Detached mode: run the container in the background and print the new container ID' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s d -l detach -d 'Detached mode: run the container in the background and print the new container ID'
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l device -d 'Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)'
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns -d 'Set custom DNS servers' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns -d 'Set custom DNS servers'
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns-opt -d "Set custom DNS options (Use --dns-opt='' if you don't wish to set options)"
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns-search -d "Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)" complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l dns-search -d "Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain)"
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s e -l env -d 'Set environment variables' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -s e -l env -d 'Set environment variables'
complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image' complete -c docker -A -f -n '__fish_seen_subcommand_from run' -l entrypoint -d 'Overwrite the default ENTRYPOINT of the image'

View File

@ -226,8 +226,9 @@ __docker_subcommand() {
"($help)*--cap-drop=-[Drop Linux capabilities]:capability: " "($help)*--cap-drop=-[Drop Linux capabilities]:capability: "
"($help)--cidfile=-[Write the container ID to the file]:CID file:_files" "($help)--cidfile=-[Write the container ID to the file]:CID file:_files"
"($help)*--device=-[Add a host device to the container]:device:_files" "($help)*--device=-[Add a host device to the container]:device:_files"
"($help)*--dns=-[Set custom dns servers]:dns server: " "($help)*--dns=-[Set custom DNS servers]:DNS server: "
"($help)*--dns-search=-[Set custom DNS search domains]:dns domains: " "($help)*--dns-opt=-[Set custom DNS options]:DNS option: "
"($help)*--dns-search=-[Set custom DNS search domains]:DNS domains: "
"($help)*"{-e,--env=-}"[Set environment variables]:environment variable: " "($help)*"{-e,--env=-}"[Set 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: "
"($help)*--env-file=-[Read environment variables from a file]:environment file:_files" "($help)*--env-file=-[Read environment variables from a file]:environment file:_files"
@ -599,7 +600,8 @@ _docker() {
"($help)--default-gateway[Container default gateway IPv4 address]:IPv4 address: " \ "($help)--default-gateway[Container default gateway IPv4 address]:IPv4 address: " \
"($help)--default-gateway-v6[Container default gateway IPv6 address]:IPv6 address: " \ "($help)--default-gateway-v6[Container default gateway IPv6 address]:IPv6 address: " \
"($help)*--dns=-[DNS server to use]:DNS: " \ "($help)*--dns=-[DNS server to use]:DNS: " \
"($help)*--dns-search=-[DNS search domains to use]" \ "($help)*--dns-search=-[DNS search domains to use]:DNS search: " \
"($help)*--dns-opt=-[DNS options to use]:DNS option: " \
"($help)*--default-ulimit=-[Set default ulimit settings for containers]:ulimit: " \ "($help)*--default-ulimit=-[Set default ulimit settings for containers]:ulimit: " \
"($help -e --exec-driver)"{-e,--exec-driver=-}"[Exec driver to use]:driver:(native lxc windows)" \ "($help -e --exec-driver)"{-e,--exec-driver=-}"[Exec driver to use]:driver:(native lxc windows)" \
"($help)*--exec-opt=-[Set exec driver options]:exec driver options: " \ "($help)*--exec-opt=-[Set exec driver options]:exec driver options: " \

View File

@ -31,6 +31,7 @@ Creates a new container.
--cpuset-mems="" Memory nodes (MEMs) in which to allow execution (0-3, 0,1) --cpuset-mems="" Memory nodes (MEMs) in which to allow execution (0-3, 0,1)
--device=[] Add a host device to the container --device=[] Add a host device to the container
--dns=[] Set custom DNS servers --dns=[] Set custom DNS servers
--dns-opt=[] Set custom DNS options
--dns-search=[] Set custom DNS search domains --dns-search=[] Set custom DNS search domains
-e, --env=[] Set environment variables -e, --env=[] Set environment variables
--entrypoint="" Overwrite the default ENTRYPOINT of the image --entrypoint="" Overwrite the default ENTRYPOINT of the image

View File

@ -23,6 +23,7 @@ weight=1
--default-gateway="" Container default gateway IPv4 address --default-gateway="" Container default gateway IPv4 address
--default-gateway-v6="" Container default gateway IPv6 address --default-gateway-v6="" Container default gateway IPv6 address
--dns=[] DNS server to use --dns=[] DNS server to use
--dns-opt=[] DNS options to use
--dns-search=[] DNS search domains to use --dns-search=[] DNS search domains to use
--default-ulimit=[] Set default ulimit settings for containers --default-ulimit=[] Set default ulimit settings for containers
-e, --exec-driver="native" Exec driver to use -e, --exec-driver="native" Exec driver to use

View File

@ -30,6 +30,7 @@ weight=1
-d, --detach=false Run container in background and print container ID -d, --detach=false Run container in background and print container ID
--device=[] Add a host device to the container --device=[] Add a host device to the container
--dns=[] Set custom DNS servers --dns=[] Set custom DNS servers
--dns-opt=[] Set custom DNS options
--dns-search=[] Set custom DNS search domains --dns-search=[] Set custom DNS search domains
-e, --env=[] Set environment variables -e, --env=[] Set environment variables
--entrypoint="" Overwrite the default ENTRYPOINT of the image --entrypoint="" Overwrite the default ENTRYPOINT of the image

View File

@ -330,8 +330,8 @@ traffic will be routed though this bridge to the container.
With the networking mode set to `host` a container will share the host's With the networking mode set to `host` a container will share the host's
network stack and all interfaces from the host will be available to the network stack and all interfaces from the host will be available to the
container. The container's hostname will match the hostname on the host container. The container's hostname will match the hostname on the host
system. Note that `--add-host` `--hostname` `--dns` `--dns-search` and system. Note that `--add-host` `--hostname` `--dns` `--dns-search`
`--mac-address` is invalid in `host` netmode. `--dns-opt` and `--mac-address` are invalid in `host` netmode.
Compared to the default `bridge` mode, the `host` mode gives *significantly* Compared to the default `bridge` mode, the `host` mode gives *significantly*
better networking performance since it uses the host's native networking stack better networking performance since it uses the host's native networking stack
@ -348,9 +348,9 @@ or a High Performance Web Server.
With the networking mode set to `container` a container will share the With the networking mode 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 `--net container:<name|id>`. Note that `--add-host` provided in the format of `--net container:<name|id>`. Note that `--add-host`
`--hostname` `--dns` `--dns-search` and `--mac-address` is invalid `--hostname` `--dns` `--dns-search` `--dns-opt` and `--mac-address` are
in `container` netmode, and `--publish` `--publish-all` `--expose` are also invalid in `container` netmode, and `--publish` `--publish-all` `--expose` are
invalid in `container` netmode. also invalid in `container` netmode.
Example running a Redis container with Redis binding to `localhost` then Example running a Redis container with Redis binding to `localhost` then
running the `redis-cli` command and connecting to the Redis server over the running the `redis-cli` command and connecting to the Redis server over the

View File

@ -21,6 +21,7 @@ docker-create - Create a new container
[**--device**[=*[]*]] [**--device**[=*[]*]]
[**--dns**[=*[]*]] [**--dns**[=*[]*]]
[**--dns-search**[=*[]*]] [**--dns-search**[=*[]*]]
[**--dns-opt**[=*[]*]]
[**-e**|**--env**[=*[]*]] [**-e**|**--env**[=*[]*]]
[**--entrypoint**[=*ENTRYPOINT*]] [**--entrypoint**[=*ENTRYPOINT*]]
[**--env-file**[=*[]*]] [**--env-file**[=*[]*]]
@ -118,6 +119,9 @@ two memory nodes.
**--dns**=[] **--dns**=[]
Set custom DNS servers Set custom DNS servers
**--dns-opt**=[]
Set custom DNS options
**--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)

View File

@ -123,6 +123,7 @@ To get information on a container use its ID or instance name:
"PublishAllPorts": false, "PublishAllPorts": false,
"Dns": null, "Dns": null,
"DnsSearch": null, "DnsSearch": null,
"DnsOptions": null,
"ExtraHosts": null, "ExtraHosts": null,
"VolumesFrom": null, "VolumesFrom": null,
"Devices": [], "Devices": [],

View File

@ -21,6 +21,7 @@ docker-run - Run a command in a new container
[**-d**|**--detach**[=*false*]] [**-d**|**--detach**[=*false*]]
[**--device**[=*[]*]] [**--device**[=*[]*]]
[**--dns**[=*[]*]] [**--dns**[=*[]*]]
[**--dns-opt**[=*[]*]]
[**--dns-search**[=*[]*]] [**--dns-search**[=*[]*]]
[**-e**|**--env**[=*[]*]] [**-e**|**--env**[=*[]*]]
[**--entrypoint**[=*ENTRYPOINT*]] [**--entrypoint**[=*ENTRYPOINT*]]
@ -185,6 +186,9 @@ stopping the process by pressing the keys CTRL-P CTRL-Q.
**--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**=[]
Set custom DNS options
**--dns**=[] **--dns**=[]
Set custom DNS servers Set custom DNS servers

View File

@ -56,6 +56,9 @@ To see the man page for a command run **man docker <command>**.
**--dns**="" **--dns**=""
Force Docker to use specific DNS servers Force Docker to use specific DNS servers
**--dns-opt**=[]
DNS options to use.
**--dns-search**=[] **--dns-search**=[]
DNS search domains to use. DNS search domains to use.