在容器终端执行的日志:
root@e75f60800589:/app# curl https://registry.npmjs.org/
^C
root@e75f60800589:/app# curl https://www.baidu.com
curl: (6) Could not resolve host: www.baidu.com
root@e75f60800589:/app# echo "nameserver 114.114.114.114">>/etc/resolv.conf
echo "nameserver 8.8.8.8">>/etc/resolv.conf
root@e75f60800589:/app# cat /etc/resolv.conf
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.
nameserver 127.0.0.11
options ndots:0
# Based on host file: '/etc/resolv.conf' (internal resolver)
# ExtServers: [100.100.2.136 100.100.2.138]
# Overrides: []
# Option ndots from: internal
nameserver 114.114.114.114
nameserver 8.8.8.8
root@e75f60800589:/app# curl https://www.baidu.com
curl: (6) Could not resolve host: www.baidu.com |