Harbor仓库问题处理

2023-10-20 14:43:46 浏览数 (3)

一、 unauthorized: authentication required

代码语言:javascript复制
[root@LWS-NODE-JP software]# docker login https://harbor.nginx.top
Username: admin
Password: 
Error response from daemon: Get "https://harbor.nginx.top/v2/": unauthorized: authentication required

解决

代码语言:javascript复制
解决方法一:
引用自: https://github.com/goharbor/harbor/issues/3114#issuecomment-424992795

在common/config/registry/config.yml中修改realm为https

解决方法二:
引用自: https://github.com/goharbor/harbor/issues/3114#issuecomment-394139225

删除/注释掉common/config/nginx/nginx.conf中的proxy_set_header X-Forwarded-Proto $scheme;

操作如下: 

sed -i '/X-Forwarded-Proto/d' common/config/nginx/nginx.conf
docker restart nginx

二、 Retrying in XXX seconds

docker push harbor 反复Retrying in XXX second

代码语言:javascript复制
[root@LWS-NODE-JP dockerfile]# docker push harbor.nginx.top/test/alpine:3.15
The push refers to repository [harbor.nginx.top/test/alpine]
8d3ac3489996: Retrying in 9 seconds 

解决

代码语言:javascript复制
[root@harbor harbor]# vim common/config/registry/config.yml 

http:
  addr: :5000
  secret: placeholder
  debug:
    addr: localhost:5001
  relativeurls: true # 添加此行

0 人点赞