From d758e89fa5f61c68ac260d24357b2993e30d1f4a Mon Sep 17 00:00:00 2001 From: Gerard Ryan Date: Mon, 25 Jan 2021 16:58:17 +1000 Subject: [PATCH] dockerd: Added option to set dns servers * The default server is the default switch so that queries will go through the hosts dnsmasq by default Signed-off-by: Gerard Ryan --- utils/dockerd/files/dockerd.init | 4 ++++ utils/dockerd/files/etc/config/dockerd | 1 + 2 files changed, 5 insertions(+) diff --git a/utils/dockerd/files/dockerd.init b/utils/dockerd/files/dockerd.init index 25ce4eff9f..54268f1258 100755 --- a/utils/dockerd/files/dockerd.init +++ b/utils/dockerd/files/dockerd.init @@ -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 diff --git a/utils/dockerd/files/etc/config/dockerd b/utils/dockerd/files/etc/config/dockerd index 6ba850bde4..72dc98624a 100644 --- a/utils/dockerd/files/etc/config/dockerd +++ b/utils/dockerd/files/etc/config/dockerd @@ -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://' # list registry_mirrors 'https://hub.docker.com' -- 2.30.2