前言
docker
在进行 build
时,报错:Get "https://registry-1.docker.io/v2/": x509: certificate is valid for
问题原因:Docker
客户端无法验证 Docker Hub
服务器的 SSL/TLS 证书
解决
在 /etc/docker/daemon.json
中新增国内镜像源:
"registry-mirrors": [
"https://6kx4zyno.mirror.aliyuncs.com",
"https://1nj0zren.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"http://f1361db2.m.daocloud.io",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://mirror.ccs.tencentyun.com/",
"https://dockerproxy.com",
"https://docker.nju.edu.cn",
"https://mirror.iscas.ac.cn",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://dockerhub.azk8s.cn",
"https://docker.m.daocloud.io"
],
systemctl daemon-reload
systemctl restart docker
重启 docker
,问题解决!