2
如何使用Docker配置自定义DNS服务器?
我需要添加几行内容,以/etc/hosts使我的Web应用程序可以在Docker容器中工作。 Docker /etc/hosts是只读的。 我正在尝试使用dnsmasq: 来自ubuntu:14.04 #... 运行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 运行echo'conf-dir = / etc / dnsmasq.d'>> /etc/dnsmasq.conf RUN echo'user = root'>> /etc/dnsmasq.conf RUN echo'nameserver 8.8.8.8'>> /etc/resolv.dnsmasq.conf RUN echo'nameserver 8.8.4.4'>> /etc/resolv.dnsmasq.conf 运行echo'address =“ / mydomain / 127.0.6.1”'>> …