无法从docker容器ping或连接到任何互联网域 Manjaro Linux
在主机/etc/docker/daemon.json
中设置的dns
/etc/resolv.conf
在docker容器中:
root@785625d57ad5:/# cat /etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8
ping
来自docker contaner(ip为google.com)
root@785625d57ad5:/# ping -c 3 172.217.23.142
PING 172.217.23.142 (172.217.23.142) 56(84) bytes of data.
64 bytes from 172.217.23.142: icmp_seq=2 ttl=53 time=51.9 ms
64 bytes from 172.217.23.142: icmp_seq=3 ttl=53 time=51.9 ms
--- 172.217.23.142 ping statistics ---
3 packets transmitted, 2 received, 33% packet loss, time 2018ms
rtt min/avg/max/mdev = 51.973/51.980/51.987/0.007 ms
root@785625d57ad5:/# ping -c 3 google.com
ping: unknown host google.com