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