I need to add a few lines to /etc/hosts for my web-app to work inside a Docker container.
Docker's /etc/hosts is read-only.
I'm trying to use dnsmasq:
RUN apt-get install -y -q dnsmasq
RUN echo 'listen-address=127.0.0.1' >> /etc/dnsmasq.conf
RUN echo 'resolv-file=/etc/resolv.dnsmasq.conf' >> /etc/dnsmasq.conf
RUN echo 'conf-dir=/etc/dnsmasq.d' >> /etc/dnsmasq.conf
It was well known that NetworkManager does not play well with dnsmasq (ref: here). I've skimmed throught the lengthy discussion here but still not sure what the recommended way to deal with the situation is.
All that I want is to do is to use dnsmasq to provide DNS and DHCP to my local network.