Skip to content

Commit 1a90c1a

Browse files
committed
disable CoreDNS if host networking is detected
1 parent 09a0854 commit 1a90c1a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
291291

292292
## Versions
293293

294+
* **06.10.20:** - Disable CoreDNS when Host networking is detected.
294295
* **04.10.20:** - Allow to specify a list of names as PEERS and add ALLOWEDIPS environment variable. Also, add peer name/id to each one of the peer sections in wg0.conf. Important: Existing users need to delete `/config/templates/peer.conf` and restart
295296
* **27.09.20:** - Cleaning service binding example to have accurate PreDown script.
296297
* **06.08.20:** - Replace resolvconf with openresolv due to dns issues when a client based on this image is connected to a server also based on this image. Add IPv6 info to readme. Display kernel version in logs.

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ app_setup_block: |
103103
104104
# changelog
105105
changelogs:
106+
- { date: "06.10.20:", desc: "Disable CoreDNS when Host networking is detected." }
106107
- { date: "04.10.20:", desc: "Allow to specify a list of names as PEERS and add ALLOWEDIPS environment variable. Also, add peer name/id to each one of the peer sections in wg0.conf. Important: Existing users need to delete `/config/templates/peer.conf` and restart" }
107108
- { date: "27.09.20:", desc: "Cleaning service binding example to have accurate PreDown script." }
108109
- { date: "06.08.20:", desc: "Replace resolvconf with openresolv due to dns issues when a client based on this image is connected to a server also based on this image. Add IPv6 info to readme. Display kernel version in logs." }

root/etc/cont-init.d/30-config

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,14 @@ else
273273
fi
274274
fi
275275

276-
# set up CoreDNS
277-
[[ ! -f /config/coredns/Corefile ]] && \
278-
cp /defaults/Corefile /config/coredns/Corefile
276+
# set up or disable CoreDNS
277+
if ip addr show dev docker0 > /dev/null 2>&1; then
278+
echo "Host networking detected, disabling CoreDNS"
279+
rm -rf /etc/services.d/coredns
280+
else
281+
[[ ! -f /config/coredns/Corefile ]] && \
282+
cp /defaults/Corefile /config/coredns/Corefile
283+
fi
279284

280285
# permissions
281286
chown -R abc:abc \

0 commit comments

Comments
 (0)