### 报错
Docker build 无法解析域名
报错:ERROR [ 2/12] RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
解决Docker build无法解析域名
# 追加到 etc/docker/daemon.json,注意JSON的格式
{
"dns": ["8.8.8.8", "114.114.114.114"]
}
# 修改完daemon.json之后
systemctl daemon-reload
systemctl docker restart
发现无法重启docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
- 进入docker目录:cd /etc/docker/
- 修改daemon的类型:mv daemon.json daemon.conf
- 重启docker:systemctl restart docker
发现无法使用k8s
是因为上面docker重启失败导致的,我们在解决了上面的docker问题之后,直接重启k8s即可。
systemctl start kubelet