Merge pull request #14935 from G-M0N3Y-2503/dockerd-use-host-dns

dockerd: Added option to configrue docker to use host Dnsmasq for DNS
This commit is contained in:
Rosen Penev 2021-02-28 01:29:22 -08:00 committed by GitHub
commit 5581f5ec48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dockerd
PKG_VERSION:=20.10.2
PKG_RELEASE:=5
PKG_RELEASE:=6
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE

View file

@ -66,9 +66,9 @@ uciadd() {
uci_quiet add firewall zone
uci_quiet rename firewall.@zone[-1]="${zone}"
uci_quiet set firewall.@zone[-1].network="${iface}"
uci_quiet set firewall.@zone[-1].input="REJECT"
uci_quiet set firewall.@zone[-1].input="ACCEPT"
uci_quiet set firewall.@zone[-1].output="ACCEPT"
uci_quiet set firewall.@zone[-1].forward="REJECT"
uci_quiet set firewall.@zone[-1].forward="ACCEPT"
uci_quiet set firewall.@zone[-1].name="${zone}"
uci_quiet commit firewall
fi
@ -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'