docker登录私仓失败cannot validate certificate for 192.168.76.131 because it doesn‘t contain any IP SANs
感谢博主:https://blog.csdn.net/qq_33733970/article/details/83618143一、搭建Harbor镜像仓库搭建脚本二、配置docker加速与私仓认证cat <<EOF > /etc/docker/daemon.json{"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"
·
感谢博主:https://blog.csdn.net/qq_33733970/article/details/83618143
一、搭建Harbor镜像仓库
二、配置docker加速与私仓认证
cat <<EOF > /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"],
"registry-mirrors": ["https://6kx4zyno.mirror.aliyuncs.com"],
"registry-mirrors": ["https://你主机的内网IP:4430"]
}
EOF
三、重启docker服务
systemctl daemon-reload
systemctl restart docker.service
四、登录harbor私仓
docker login https://192.168.11.128:4430/harbor -uadmin
报错信息:
Error response from daemon: Get https://192.168.76.131:4430/v2/: x509: cannot validate certificate for 192.168.76.131 because it doesn't contain any IP SANs
五、最后解决办法感谢上面提到博主的文章,解决如下:
vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --insecure-registry https://192.168.76.131:4430
六、再次重启docker服务
systemctl daemon-reload && systemctl restart docker.service
七、再次登录Harbor私仓
docker login https://192.168.11.128:4430/harbor -uadmin
八、查看认证文件
cat /root/.docker/config.json
九、拉取镜像
docker pull 192.168.11.128:4430/library/jenkins:latest
OK,拉取成功镜像。
十、重新配置docker加速与私仓认证(可跳过上面第五步骤)
1、重新配置docker私仓认证
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://vgljcdk8.mirror.aliyuncs.com"],
"insecure-registries": ["https://192.168.11.128:4430"]
}
2、恢复原配置
vim /usr/lib/systemd/system/docker.service
3、删除docker认证文件与重启docker服务
rm -rf /root/.docker/ && systemctl daemon-reload && systemctl restart docker.service
4、再次拉取镜像
docker pull 192.168.11.128:4430/library/jenkins:latest
更多推荐
已为社区贡献3条内容
所有评论(0)