一、查看宿主机dns
[root@localhost ~]# cat /etc/resolv.conf # Generated by NetworkManager nameserver 114.114.114.114 nameserver 8.8.8.8
二、将dns配置到/etc/docker/daemon.json
"dns": ["114.114.114.114","8.8.8.8"]
三、重启docker
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
四、启动容器验证