Browse Source

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

Dockerd: Added option to configrue docker to use host Dnsmasq for DNS
lilik-openwrt-22.03
Florian Eckert 4 years ago
committed by GitHub
parent
commit
5e0ef1d535
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions
  1. +1
    -1
      utils/dockerd/Makefile
  2. +6
    -2
      utils/dockerd/files/dockerd.init
  3. +1
    -0
      utils/dockerd/files/etc/config/dockerd

+ 1
- 1
utils/dockerd/Makefile View File

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


+ 6
- 2
utils/dockerd/files/dockerd.init View File

@ -66,9 +66,9 @@ uciadd() {
uci_quiet add firewall zone uci_quiet add firewall zone
uci_quiet rename firewall.@zone[-1]="${zone}" uci_quiet rename firewall.@zone[-1]="${zone}"
uci_quiet set firewall.@zone[-1].network="${iface}" 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].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 set firewall.@zone[-1].name="${zone}"
uci_quiet commit firewall uci_quiet commit firewall
fi fi
@ -142,6 +142,7 @@ process_config() {
config_get bip globals bip "" config_get bip globals bip ""
config_get registry_mirrors globals registry_mirrors "" config_get registry_mirrors globals registry_mirrors ""
config_get hosts globals hosts "" config_get hosts globals hosts ""
config_get dns globals dns ""
. /usr/share/libubox/jshn.sh . /usr/share/libubox/jshn.sh
json_init json_init
@ -155,6 +156,9 @@ process_config() {
[ -z "${hosts}" ] || json_add_array "hosts" [ -z "${hosts}" ] || json_add_array "hosts"
[ -z "${hosts}" ] || config_list_foreach globals hosts json_add_array_string [ -z "${hosts}" ] || config_list_foreach globals hosts json_add_array_string
[ -z "${hosts}" ] || json_close_array [ -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}" json_dump > "${DOCKERD_CONF}"
[ "${iptables}" -eq "1" ] && config_foreach iptables_add_blocking_rule firewall [ "${iptables}" -eq "1" ] && config_foreach iptables_add_blocking_rule firewall


+ 1
- 0
utils/dockerd/files/etc/config/dockerd View File

@ -11,6 +11,7 @@ config globals 'globals'
option iptables '1' option iptables '1'
# list hosts 'unix:///var/run/docker.sock' # list hosts 'unix:///var/run/docker.sock'
# option bip '172.18.0.1/24' # 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://<my-docker-mirror-host>'
# list registry_mirrors 'https://hub.docker.com' # list registry_mirrors 'https://hub.docker.com'


Loading…
Cancel
Save