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登录私仓失败cannot validate certificate for 192.168.76.131 because it doesn‘t contain any IP SANs_第1张图片


二、配置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.76.131: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登录私仓失败cannot validate certificate for 192.168.76.131 because it doesn‘t contain any IP SANs_第2张图片
六、再次重启docker服务

systemctl   daemon-reload
systemctl   restart docker.service 

七、再次登录Harbor私仓

docker  login https://192.168.76.131:4430/harbor -uadmin

在这里插入图片描述

八、查看认证文件

cat /root/.docker/config.json

docker登录私仓失败cannot validate certificate for 192.168.76.131 because it doesn‘t contain any IP SANs_第3张图片

你可能感兴趣的:(docker)