docker已证书方式访问harbor
镜像仓库地址: harbor.live.com
首先导入一个镜像
docker load -i nginx-ingress-controller.tar
1.# 登陆到docker机器,创建 /etc/docker/certs.d/harbor.live.com 目录,并把将harbor证书的CA证书,从master复制进去
ssh 10.0.0.6 'sudo mkdir -p /etc/docker/certs.d/harbor.live.com/;sudo chown k8s.k8s /etc/docker/certs.d/harbor.live.com/'
scp /etc/kubernetes/cert/ca.pem 10.0.0.6:/etc/docker/certs.d/harbor.live.com/
2.登陆认证
docker login harbor.live.com 进行登陆,登陆后,认证文件会写入 ~/.docker/config.json
3.修改镜像的tags
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:0.23.0 harbor.live.com/public/nginx-ingress-controller:0.23.0
4.上传镜像
docker push harbor.live.com/public/nginx-ingress-controller:0.23.0