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

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

问题描述

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



我已经尝试推送一个图像,但是当我尝试搜索一个图像我得到404: / p>

  root @ ip-10-232-0-153:〜#curl -v -X GET http:// localhost:5000 / v2 / search 
*在DNS缓存中找不到主机名
*尝试127.0.0.1 ...
*连接到localhost(127.0.0.1)端口5000(#0)
。 GET / v2 / search HTTP / 1.1
> User-Agent:curl / 7.35.0
>主机:localhost:5000
>接受:* / *
>
< HTTP / 1.1 404未找到
< Content-Type:text / plain; charset = utf-8
< Docker-Distribution-Api-Version:registry / 2.0
<日期:星期五,2015年5月8日00:00:45 GMT
< Content-Length:19
<
404页面未找到
*连接#0托管localhost保持原样

当我尝试curl localhost:5000,我只得到一个404:

  404页面未找到


解决方案

更新分发路线图中,但此处是关于搜索的特定问题



UPDATE (2015年11月12日):API端点仍然不存在,但尚未在Docker注册表路线图中。



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



因此在v2注册中没有搜索端点然而。您可以按标签或图片名称本身列出图片,如任务8中所述本文档


I pulled and setup the local docker registry:2.0

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

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

404 page not found

解决方案

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

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

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.

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天全站免登陆