dockerd: Added option to set dns servers
authorGerard Ryan <[email protected]>
Mon, 25 Jan 2021 06:58:17 +0000 (16:58 +1000)
committerGerard Ryan <[email protected]>
Thu, 25 Feb 2021 11:33:39 +0000 (21:33 +1000)
* The default server is the default switch so that
  queries will go through the hosts dnsmasq by default

Signed-off-by: Gerard Ryan <[email protected]>
utils/dockerd/files/dockerd.init
utils/dockerd/files/etc/config/dockerd

index 25ce4eff9ff5cb1c98aaa03bfdec90d45f7f7f5d..54268f1258fe1ec5b480561e1337853f29b50291 100755 (executable)
@@ -142,6 +142,7 @@ process_config() {
        config_get bip globals bip ""
        config_get registry_mirrors globals registry_mirrors ""
        config_get hosts globals hosts ""
+       config_get dns globals dns ""
 
        . /usr/share/libubox/jshn.sh
        json_init
@@ -155,6 +156,9 @@ process_config() {
        [ -z "${hosts}" ] || json_add_array "hosts"
        [ -z "${hosts}" ] || config_list_foreach globals hosts json_add_array_string
        [ -z "${hosts}" ] || json_close_array
+       [ -z "${dns}" ] || json_add_array "dns"
+       [ -z "${dns}" ] || config_list_foreach globals dns json_add_array_string
+       [ -z "${dns}" ] || json_close_array
        json_dump > "${DOCKERD_CONF}"
 
        [ "${iptables}" -eq "1" ] && config_foreach iptables_add_blocking_rule firewall
index 6ba850bde486d6e96e31f3eb8bc75b6877cc838c..72dc98624a69c7559879ea3ac28c7c86b6388c1c 100644 (file)
@@ -11,6 +11,7 @@ config globals 'globals'
        option iptables '1'
 #      list hosts 'unix:///var/run/docker.sock'
 #      option bip '172.18.0.1/24'
+#      list dns '172.17.0.1'
 #      list registry_mirrors 'https://<my-docker-mirror-host>'
 #      list registry_mirrors 'https://hub.docker.com'