lilygg 2020-05-29
首先使用命令查找宿主机的DNS server,命令:
nmcli dev show | grep ‘IP4.DNS‘或者nmcli dev show | grep DNS
然后create一个文件,使用命令:
vim /etc/docker/daemon.json
编辑信息:
{ "dns": ["202.96.209.5","8.8.8.8"] }
重启Docker服务,命令:
systemctl daemon-reload
systemctl restart docker