我尝试创建带有自定义网络和dos设置的停靠容器。
docker网络创建-驱动程序=桥-opt "com.docker.network.bridge.enable_ip_masquerade"="true“-选择"com.docker.network.bridge.enable_icc"="true”-opt=“com.docker.network.driver.mtu”=“1500”--opt="com.docker.network.bridge.host_binding_ipv4"="0.0.0.0“net
--
docker运行-dns 10.0.0.2 -network=net busybox cat /etc/cat 名称服务器127.0.0.11选项ndots:0
否则,如果我使用标准网络,一切正常工作。
docker run -dns 10.0.0.2 -网络=桥式总线盒cat /etc/drv.conf 名称服务器10.0.0.2
发布于 2016-11-09 19:11:40
从Docker 1.10开始,DNS对用户定义的网络进行了不同的管理.默认网桥网络的DNS保持不变,以实现向后兼容性。在用户定义的网络中,docker守护进程使用嵌入式DNS服务器.根据这里发现的文件:
https://docs.docker.com/engine/userguide/networking/configure-dns/
--dns=[IP_ADDRESS...] The IP addresses passed via the --dns option is used by the embedded
DNS server to forward the DNS query if embedded DNS server is unable
to resolve a name resolution request from the containers. These
--dns IP addresses are managed by the embedded DNS server and will not
be updated in the container’s /etc/resolv.conf file.因此,将使用DNS名称服务器,它只是在容器的/etc/rupv.conf中不可见。
https://stackoverflow.com/questions/40483053
复制相似问题