oofnikj / docker-openwrt

OpenWrt running in Docker
GNU General Public License v2.0
299 stars 63 forks source link

move resolv.conf fix to rc.local to avoid race condition #15

Closed oofnikj closed 3 years ago

oofnikj commented 3 years ago

Docker bind mounts /etc/resolv.conf from the host, overwriting the symlink from /tmp/resolv.conf, which breaks DNS functionality inside the container (but not for LAN clients). We restore it by overwriting the contents of the bind-mounted file from /tmp.

Previously this was done by executing a process in run.sh, but this resulted in a race condition where sometimes /tmp/resolv.conf was ready, sometimes, it wasn't. By moving to /etc/rc.local, it's guaranteed to run after system init is done.