使用docker-compose安装harbor,配置ssl证书后使用nginx反向代理到harbor.配置后安装docker可以直接用域名登录harbor,无需配置私有仓库
nginx配置
1.修改harbor配置文件

2.nginx配置

 

另:

创建证书脚本:

 

问题:

docker pull ycr.yyiuap.com/base/golang:alphine-node-3
Error response from daemon: received unexpected HTTP status: 503 Service Unavailable

解决:

去掉 http_proxy代理即可

参考:https://blog.csdn.net/oscarun/article/details/121395218

 

1、request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)错误:

[root@iZrj9j76z8dlull9vqa4tqZ ~]# docker pull harbor.xxx.cn:443/1-1/mytomcat:8.5.52
Error response from daemon: Head https://harbor.xxx.cn:443/v2/1-1/mytomcat/manifests/8.5.52: Get http://10.20.31.104:5000/service/token?scope=repository%3A1-1%2Fmytomcat%3Apull&service=harbor-registry: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

解决方案:修改harbor.yml配置文件,取消external_url注释,设置为:external_url: https://harbor.xxx.cn,注意https://harbor.xxx.cn后面不能写端口。

然后,docker-compose down停止所有服务,删除当前配置目录:rm -rf ./common/config下配置清单,重新执行install.sh生成配置,即可解决

2、dial tcp: lookup harbor.xxx.cn;: no such host错误:

解决方案:修改harbor.yml配置文件,hostname字段只写harbor.xxx.cn,域名前面不要写http/https协议。

3、Harbor重启失败,报ERROR: for harbor-portal Cannot start service portal: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused错误

解决方案:https://blog.csdn.net/qq_39680564/article/details/107237110

注意:只要修改了harbor.yml,要想让配置生效,需要删除当前配置目录:rm -rf ./common/config下配置清单,重新执行install.sh生成配置。

 

Categories: MIDDLEWARE未分类

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *