Docker 注册表 2.0 API v2 [英] Docker registry 2.0 API v2

查看:23
本文介绍了Docker 注册表 2.0 API v2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拉取并设置了本地 docker 注册表:2.0

I pulled and setup the local docker registry:2.0

我已经尝试成功推送图像,但是每当我尝试搜索图像时,我都会收到 404:

I have tried pushing an image successfully, but when ever I try searching for an image I get 404:

root@ip-10-232-0-153:~# curl -v -X GET http://localhost:5000/v2/search
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /v2/search HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:5000
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< Docker-Distribution-Api-Version: registry/2.0
< Date: Fri, 08 May 2015 00:00:45 GMT
< Content-Length: 19
<
404 page not found
* Connection #0 to host localhost left intact

此外,当我尝试 curl localhost:5000 时,我只会得到一个 404:

Also when I try to curl localhost:5000, I just get a 404:

404 page not found

推荐答案

UPDATE(2016 年 4 月 14 日):仍然不在 分发路线图,但这里有一个 关于搜索的特殊问题.

UPDATE (14 April 2016): Still not here in the distribution roadmap, but here is a particular issue about search.

更新(2015 年 11 月 12 日):API 端点仍然不存在,也不在 Docker Registry 路线图中.

UPDATE (12 November 2015): The API endpoints still do not yet exist and are not yet in the Docker Registry roadmap.

这里的问题是新的 v2 Docker 注册表不支持该特定端点yet,就这个问题和答案而言.您可以检查源本身以获取路线端点,您会看到大多数 API 端点都涉及简单的操作,例如上传和标记,但尚未实现搜索端点.重要的是要注意 v2 注册表是一个与 v1 注册表完全不同的项目.它甚至是用完全不同的语言编写的(v1 是一个 Python 项目,而 v2 使用 Go,这更符合其余的 Docker 项目).我花了一些时间和认真的阅读来理解注册管理机构之间的二分法.值得查看在这个关于 v2 注册表的特定 Github 问题 以深入了解最近关于 v2 注册表状态的讨论,以及一些关于他们将它带到哪里的讨论.

The problem here is that the new v2 Docker registry doesn't support that particular endpoint yet, as of this question and answer. You can check the source itself for the route endpoints, and you'll see that most of the API endpoints involve simple operations like uploading and tagging, but no implementation yet of the search endpoint. It's important here to note that the v2 registry is a completely different project than the v1 registry. It's even written in a completely different language (v1 was a Python project, whereas v2 uses Go, which is more in line with the rest of the Docker projects). It took me some time and serious reading to understand the dichotomy here between the registries. It is worth looking at this particular Github issue about the v2 registry for a deep-dive into a recent discussion on the state of the v2 registry, as well as some discussion about where they've been taking it.

所以 v2 注册表中还没有搜索端点.您可以按标签或图像名称本身列出您的图像,如任务编号 8 本文档中所述.

So there's no search endpoint in the v2 registry yet. You can list your image by tag or by the image name itself as mentioned in task number 8 in this documentation.

这篇关于Docker 注册表 2.0 API v2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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