Error response from daemon: Get “*“: x509: certificate signed by unknown authority

环境说明

我搭建的harbor仓库,是需要用域名和https方式访问

报错一,其他docker环境登陆harbor时

[root@k8s0001 ~]# docker login www.harbor.wuhan.cn
Username: admin
Password: 
Error response from daemon: Get "https://www.harbor.wuhan.cn/v2/": x509: certificate signed by unknown authority

报错二,其他docker环境拉取自建harbor仓库镜像时

[root@k8s0001 ~]# docker pull www.harbor.wuhan.cn/22202/helloworld@sha256:0d9ce49958ea82a48c40a397ccc785674ec3ce1dfd4f749c3c7c7a63790a54cd
Error response from daemon: Get "https://www.harbor.wuhan.cn/v2/": x509: certificate signed by unknown authority

这两个报错的需要把生成的密钥cp到对应机器docker的配置文件目录即可,操作如下:

配置https链接

##harbor所在服务器
[root@harbor opt]# cd /etc/docker/
[root@harbor docker]# ls
certs.d  key.json
[root@harbor docker]# cd certs.d/
[root@harbor certs.d]# ls
www.harbor.wuhan.cn
[root@harbor certs.d]# cd www.harbor.wuhan.cn/
[root@harbor www.harbor.wuhan.cn]# ls
ca.crt  www.harbor.wuhan.cn.cert  www.harbor.wuhan.cn.key
[root@harbor certs.d]# cd ..
[root@harbor certs.d]# scp -r www.harbor.wuhan.cn root@192.168.9.78:/etc/docker/certs.d/ 
root@192.168.9.78's password: 
www.harbor.wuhan.cn.cert                                                                          100% 2126   914.9KB/s   00:00    
www.harbor.wuhan.cn.key                                                                           100% 3243     1.5MB/s   00:00    
ca.crt                                                                                             100% 2033   839.2KB/s   00:00    
[root@harbor certs.d]# 
[root@harbor certs.d]# scp -r www.harbor.wuhan.cn root@192.168.9.79:/etc/docker/certs.d/
root@192.168.9.79's password: 
www.harbor.wuhan.cn.cert                                                                          100% 2126   845.3KB/s   00:00    
www.harbor.wuhan.cn.key                                                                           100% 3243     1.9MB/s   00:00    
ca.crt                                                                                             100% 2033     1.8MB/s   00:00    
[root@harbor certs.d]# 
[root@harbor certs.d]# 
[root@harbor certs.d]# scp -r www.harbor.wuhan.cn root@192.168.9.80:/etc/docker/certs.d/
root@192.168.9.80's password: 
www.harbor.wuhan.cn.cert                                                                          100% 2126   227.8KB/s   00:00    
www.harbor.wuhan.cn.key                                                                           100% 3243     2.5MB/s   00:00    
ca.crt                                                                                             100% 2033     1.2MB/s   00:00 

然后重启上述docker即可

[root@k8s0001 opt]# systemctl restart docker
[root@k8s0002 opt]# systemctl restart docker
[root@k8s0003 opt]# systemctl restart docker
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值