docker harbor x509: certificate signed by unknown authority action: push: unauthorized to access repository

问题:

[root@win82 win81.inno.com]# docker push win81.inno.com:443/test/busybox
Using default tag: latest
The push refers to repository [win81.inno.com:443/test/busybox]
Get https://win81.inno.com:443/v2/: x509: certificate signed by unknown authority

解决:

将harbor 的主机crt 放到要push 的主机目录/etc/pki/ca-trust/source/anchors/
[root@win81 cert]# pwd
/data/cert
[root@win81 cert]# scp -p win81.inno.com.crt win82:/etc/pki/ca-trust/source/anchors/
win81.inno.com.crt                                                                                                                        100% 2126     1.0MB/s   00:00 

在push 主机上更新
[root@win82 certs]# update-ca-trust

出现另个一个问题

[root@win82 certs]# docker push win81.inno.com:443/test/busybox:latest
The push refers to repository [win81.inno.com:443/test/busybox]
1dad141bdb55: Preparing 
unauthorized: unauthorized to access repository: test/busybox, action: push: unauthorized to access repository: test/busybox, action: push

登录后再试

[root@win82 certs]# docker login win81.inno.com:443
Username: admin
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@win82 certs]# docker push win81.inno.com:443/test/busybox:latest
The push refers to repository [win81.inno.com:443/test/busybox]
1dad141bdb55: Pushed 
latest: digest: sha256:99243e861067446c9aed305b5690cccb88658d23af3fde338398f27386ded1be size: 527