0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-25 09:10:39 +00:00

Merge pull request #139 from jmccann/dns_search

Add ability to define DNS Search for docker daemon
This commit is contained in:
Brad Rydzewski 2017-08-25 10:01:13 -07:00 committed by GitHub
commit 7636c99bb6
2 changed files with 10 additions and 0 deletions

View File

@ -70,6 +70,11 @@ func main() {
Usage: "docker daemon dns server",
EnvVar: "PLUGIN_CUSTOM_DNS",
},
cli.StringSliceFlag{
Name: "daemon.dns-search",
Usage: "docker daemon dns search domains",
EnvVar: "PLUGIN_CUSTOM_DNS_SEARCH",
},
cli.BoolFlag{
Name: "daemon.insecure",
Usage: "docker daemon allows insecure registries",
@ -205,6 +210,7 @@ func run(c *cli.Context) error {
Debug: c.Bool("daemon.debug"),
Bip: c.String("daemon.bip"),
DNS: c.StringSlice("daemon.dns"),
DNSSearch: c.StringSlice("daemon.dns-search"),
MTU: c.String("daemon.mtu"),
Experimental: c.Bool("daemon.experimental"),
},

View File

@ -26,6 +26,7 @@ type (
Debug bool // Docker daemon started in debug mode
Bip string // Docker daemon network bridge IP address
DNS []string // Docker daemon dns server
DNSSearch []string // Docker daemon dns search domain
MTU string // Docker daemon mtu setting
IPv6 bool // Docker daemon IPv6 networking
Experimental bool // Docker daemon enable experimental mode
@ -301,6 +302,9 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
for _, dns := range daemon.DNS {
args = append(args, "--dns", dns)
}
for _, dnsSearch := range daemon.DNSSearch {
args = append(args, "--dns-search", dnsSearch)
}
if len(daemon.MTU) != 0 {
args = append(args, "--mtu", daemon.MTU)
}