尝试获取Docker Hub目录时,范围不足 [英] Insufficient scope when attempting to get Docker Hub catalog

查看:1282
本文介绍了尝试获取Docker Hub目录时,范围不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到Docker hub的目录列表,但到目前为止,我只是收到一个错误。我的理解是,我需要传递一个载体令牌与目录请求,所以我开始得到相关范围的令牌:

I'm attempting to get a catalog listing for Docker hub, but so far I'm just getting an error in response. My understanding is I'd need to pass a bearer token with the catalog request, so I start by getting that token with the related scope:

curl -u "username:password "https://auth.docker.io/token?service=registry.docker.io&scope=registry:catalog:*"

(这是使用我的Docker Hub帐户的用户名/密码)

(this is using username/password from my Docker Hub account)

然后我传递将令牌返回到注册表:

I then pass the returned token to the registry:

curl -vL -H "Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6I(...)" https://registry-1.docker.io/v2/_catalog

为了回应这个请求,我得到:

In response to that request, I'm getting:

*   Trying 54.86.130.73...
* Connected to registry-1.docker.io (54.86.130.73) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.docker.io
* Server certificate: RapidSSL SHA256 CA - G3
* Server certificate: GeoTrust Global CA
> GET /v2/_catalog HTTP/1.1
> Host: registry-1.docker.io
> User-Agent: curl/7.43.0
> Accept: */*
> Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6I(...)
>
< HTTP/1.1 401 Unauthorized
HTTP/1.1 401 Unauthorized
< Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
< Docker-Distribution-Api-Version: registry/2.0
Docker-Distribution-Api-Version: registry/2.0
< Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="registry:catalog:*",error="insufficient_scope"
Www-Authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="registry:catalog:*",error="insufficient_scope"
< Date: Fri, 06 May 2016 23:00:08 GMT
Date: Fri, 06 May 2016 23:00:08 GMT
< Content-Length: 134
Content-Length: 134
< Strict-Transport-Security: max-age=31536000
Strict-Transport-Security: max-age=31536000
<
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"registry","Name":"catalog","Action":"*"}]}]}

...这似乎在问我返回并获得我上面输入的URL的授权。

...which seems to be asking me to go back and get authorized with the URL I entered above.

应该可以吗?如果是这样,我还缺少什么?

Should this be possible? If so, what am I missing?

推荐答案

我遇到同样的问题,提出了docker支持,并得到以下答案,
目录端点对Docker Hub不起作用,因为该端点实际上列出了注册表中的所有存储库,我们禁用了它,因为它会列出Docker Hub上的所有存储库。

I got the same problem, raised this with docker support and got the following answer, "The catalog endpoint does not work against Docker Hub because that endpoint actually lists all the repositories on a Registry, and we disabled it as it would list all repositories on Docker Hub."

这篇关于尝试获取Docker Hub目录时,范围不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆