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 <G.M0N3Y.2503@gmail.com>
This commit is contained in:
Gerard Ryan 2021-01-25 16:58:17 +10:00
parent 66ba43293e
commit 398af87bdd
2 changed files with 5 additions and 0 deletions

View File

@ -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

View 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'