Add ability to define DNS Search for docker daemon
This commit is contained in:
parent
c4b5d2834d
commit
38f14da620
6
main.go
6
main.go
@ -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"),
|
||||
},
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user