harbor 中 使用 push 上传镜像时候 显示 没有认证

7 篇文章 0 订阅
4 篇文章 0 订阅


harbor 中 使用 upload 上传镜像时候 显示 没有认证



概述:

VMware harbor 安装完成后,

 使用docker tag 打新的标签,

然后 用docker push上传镜像的时候,

显示 安全方面的错误。



1.
客户端显示信息
[root@ip-172-30-0-20 ~]# docker push   172.30.0.20:5000/busybox:cloud
The push refers to a repository [172.30.0.20:5000/busybox]
5f70bf18a086: Image push failed
1834950e52ce: Image push failed
unauthorized: authentication required
[root@ip-172-30-0-20 ~]#

2. 服务器端:
registry_1  |time="2016-06-08T11:02:29.929222341Z" level=debugmsg="authorizing request" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=300a9dbe-6027-41bb-a9a3-64e7eaf68f76 http.request.method=GEThttp.request.remoteaddr="172.30.0.20:41271"http.request.uri="/v2/"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registry version=v2.4.0
registry_1 
|time="2016-06-08T11:02:29.929388489Z" level=warning msg="errorauthorizing context: authorization token required" go.version=go1.6.1http.request.host="172.30.0.20:5000" http.request.id=300a9dbe-6027-41bb-a9a3-64e7eaf68f76http.request.method=GET http.request.remoteaddr="172.30.0.20:41271"http.request.uri="/v2/"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64" instance.id=71df9a7e-0ec8-4522-8978-bbd01813541fservice=registry version=v2.4.0
registry_1 
| 172.30.0.20 - -[08/Jun/2016:11:02:29 +0000] "GET /v2/ HTTP/1.1" 401 87 """docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"
ui_1       
| 2016-06-08T11:02:29Z [INFO]request url:/service/token?scope=repository%3Abusybox%3Apush%2Cpull&service=token-service
ui_1       
| 2016-06-08T11:02:29Z[DEBUG] [authenticator.go:52]: Current AUTH_MODE is db_auth
ui_1       
| 2016-06-08T11:02:29Z[DEBUG] [authutils.go:42]: scopes: [repository:busybox:push,pull]
ui_1       
| 2016-06-08T11:02:29Z [INFO]current access, type: repository, name:busybox, actions:[]
ui_1        | 2016/06/08 11:02:29[router.go:828][D] | GET        |/service/token                          | 36.754061ms      | match      | /service/token                          
|
registry_1 
|time="2016-06-08T11:02:29.973905388Z" level=debugmsg="authorizing request" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=f7031b1d-2055-43db-8bcc-a587d95dc1bf http.request.method=HEADhttp.request.remoteaddr="172.30.0.20:41275"http.request.uri="/v2/busybox/blobs/sha256:385e281300cc6d88bdd155e0931fbdfbb1801c2b0265340a40481ee2b733ae66"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registryvars.digest="sha256:385e281300cc6d88bdd155e0931fbdfbb1801c2b0265340a40481ee2b733ae66"vars.name=busybox version=v2.4.0
registry_1 
| time="2016-06-08T11:02:29.974703102Z"level=warning msg="error authorizing context: insufficient scope"go.version=go1.6.1 http.request.host="172.30.0.20:5000"http.request.id=f7031b1d-2055-43db-8bcc-a587d95dc1bf http.request.method=HEADhttp.request.remoteaddr="172.30.0.20:41275"http.request.uri="/v2/busybox/blobs/sha256:385e281300cc6d88bdd155e0931fbdfbb1801c2b0265340a40481ee2b733ae66"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registryvars.digest="sha256:385e281300cc6d88bdd155e0931fbdfbb1801c2b0265340a40481ee2b733ae66"vars.name=busybox version=v2.4.0
registry_1 
| 172.30.0.20 - -[08/Jun/2016:11:02:29 +0000] "HEAD /v2/busybox/blobs/sha256:385e281300cc6d88bdd155e0931fbdfbb1801c2b0265340a40481ee2b733ae66HTTP/1.1" 401 139 "" "docker/1.10.3-cs3 go/go1.5.4git-commit/6df5588 kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"
registry_1 
|time="2016-06-08T11:02:29.975992181Z" level=debugmsg="authorizing request" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=2aed3a1d-8bd2-4b4a-9507-9aa01f76d009 http.request.method=HEADhttp.request.remoteaddr="172.30.0.20:41274" http.request.uri="/v2/busybox/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registryvars.digest="sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"vars.name=busybox version=v2.4.0
registry_1 
|time="2016-06-08T11:02:29.976514194Z" level=warning msg="errorauthorizing context: insufficient scope" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=2aed3a1d-8bd2-4b4a-9507-9aa01f76d009 http.request.method=HEADhttp.request.remoteaddr="172.30.0.20:41274"http.request.uri="/v2/busybox/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registryvars.digest="sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"vars.name=busybox version=v2.4.0
registry_1 
| 172.30.0.20 - -[08/Jun/2016:11:02:29 +0000] "HEAD/v2/busybox/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4HTTP/1.1" 401 139 "" "docker/1.10.3-cs3 go/go1.5.4git-commit/6df5588 kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"
proxy_1    
| 54.172.254.196 - -[08/Jun/2016:11:02:29 +0000] "GET/service/token?scope=repository%3Abusybox%3Apush%2Cpull&service=token-serviceHTTP/1.1" 200 1157 "-" "docker/1.10.3-cs3 go/go1.5.4git-commit/6df5588 kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"


3. 解决
a)
先 登录
docker login -u admin -p Harbor12345 -e sample_admin@mydomain.com  172.30.0.20:5000
[root@ip-172-30-0-20 ~]# docker login -u admin -p Harbor12345 -esample_admin@mydomain.com 172.30.0.20:5000
WARNING: login credentials saved in /root/.docker/config.json
Login Succeeded
[root@ip-172-30-0-20 ~]#

b)
文件内容
        "auths": {
               
"172.30.0.20:5000": {
                       
"auth":"YWRtaW46SGFyYm9yMTIzNDU=",
                       
"email": "sample_admin@mydomain.com"
               
}
       
}
}

c)
服务器端输出
registry_1  |time="2016-06-08T11:08:27.101055472Z" level=debugmsg="authorizing request" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=4fb2a7ec-9446-4e09-8c13-5fb71f091261 http.request.method=GEThttp.request.remoteaddr="172.30.0.20:41278"http.request.uri="/v2/"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registryversion=v2.4.0
registry_1 
|time="2016-06-08T11:08:27.101137779Z" level=warning msg="errorauthorizing context: authorization token required" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=4fb2a7ec-9446-4e09-8c13-5fb71f091261 http.request.method=GEThttp.request.remoteaddr="172.30.0.20:41278"http.request.uri="/v2/"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registryversion=v2.4.0
registry_1 
| 172.30.0.20 - -[08/Jun/2016:11:08:27 +0000] "GET /v2/ HTTP/1.1" 401 87 """docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"
ui_1       
| 2016-06-08T11:08:27Z [INFO]request url: /service/token?account=admin&service=token-service
ui_1       
| 2016-06-08T11:08:27Z[DEBUG] [authenticator.go:52]: Current AUTH_MODE is db_auth
ui_1       
| 2016-06-08T11:08:27Z[DEBUG] [authutils.go:42]: scopes: []
ui_1        | 2016/06/08 11:08:27[router.go:828][D] | GET        |/service/token                          | 29.821542ms      | match      | /service/token                           
|
registry_1 
|time="2016-06-08T11:08:27.137128678Z" level=debugmsg="authorizing request" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=6a912eb4-3932-43fe-bdff-6e84c45d70a4 http.request.method=GEThttp.request.remoteaddr="172.30.0.20:41281"http.request.uri="/v2/"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"instance.id=71df9a7e-0ec8-4522-8978-bbd01813541f service=registry version=v2.4.0
registry_1 
|time="2016-06-08T11:08:27.13791445Z" level=info msg="responsecompleted" go.version=go1.6.1http.request.host="172.30.0.20:5000"http.request.id=6a912eb4-3932-43fe-bdff-6e84c45d70a4 http.request.method=GEThttp.request.remoteaddr="172.30.0.20:41281" http.request.uri="/v2/"http.request.useragent="docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"http.response.contenttype="application/json; charset=utf-8"http.response.duration=1.934938ms http.response.status=200http.response.written=2 instance.id=71df9a7e-0ec8-4522-8978-bbd01813541fservice=registry version=v2.4.0
registry_1 
| 172.30.0.20 - -[08/Jun/2016:11:08:27 +0000] "GET /v2/ HTTP/1.1" 200 2 """docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588 kernel/3.10.0-327.el7.x86_64os/linux arch/amd64"
proxy_1    
| 54.172.254.196 - admin[08/Jun/2016:11:08:27 +0000] "GET/service/token?account=admin&service=token-service HTTP/1.1" 200 1099"-" "docker/1.10.3-cs3 go/go1.5.4 git-commit/6df5588kernel/3.10.0-327.el7.x86_64 os/linux arch/amd64"



d)
上传 image客户端
[root@ip-172-30-0-20 ~]# docker tag busybox 172.30.0.20:5000/library/my

[root@ip-172-30-0-20 ~]# docker push 172.30.0.20:5000/library/my
The push refers to a repository [172.30.0.20:5000/library/my]
5f70bf18a086: Pushed
1834950e52ce: Pushed
latest: digest:sha256:6757d4b17cd75742fc3b1fc1a8d02b45b637f2ac913ee9669f5c2aed0c9b26ba size:711
[root@ip-172-30-0-20 ~]#

e)
服务器端输出 (部分)
。。。。。。。。
ui_1        | 2016/06/08 11:30:57[router.go:828][D] | POST       |/service/notifications                  | 190.034µs        | match      | /service/notifications                   |
ui_1        | 2016/06/08 11:30:57[router.go:828][D] | POST       |/service/notifications                  | 129.273µs        | match      | /service/notifications                  
| ))

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
镜像pushHarbor后,如果镜像丢失,可能有几个原因。首先,可能是在推送镜像的过程出现了错误,导致镜像没有成功上Harbor。其次,可能是在推送镜像后,Harbor的存储空间不足,导致镜像被删除以释放空间。最后,可能是在Harbor的配置设置了自动清理策略,导致镜像被自动删除。 为了解决这个问题,可以按照以下步骤进行排查和处理: 1. 首先,检查推送镜像的过程是否有任何错误信息。可以查看推送镜像的命令输出或者Harbor的日志文件,以确定是否有任何错误发生。 2. 确保Harbor的存储空间足够,可以通过查看Harbor的存储配置或者联系系统管理员来确认。 3. 检查Harbor的配置,查看是否设置了自动清理策略。如果设置了自动清理策略,可以调整策略或者禁用自动清理来避免镜像被删除。 4. 如果以上步骤都没有解决问题,可以尝试重新推送镜像Harbor,并确保推送过程没有任何错误。 通过以上步骤,您应该能够解决镜像pushHarbor后丢失的问题。如果问题仍然存在,建议您联系Harbor的技术支持或者咨询相关专业人士以获取进一步的帮助。 #### 引用[.reference_title] - *1* *2* *3* [如何正确推送镜像到私有仓库Harbor(http方式)](https://blog.csdn.net/Xin_101/article/details/124422018)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值