Docker 1.6和Registy 2.0

有没有人试图成功与Docker 1.6和新的registry2.0的search命令?

我使用SSL设置了Nginx的背后,到目前为止,它工作正常。 我可以毫无问题地pull图像。 但是当我尝试search它们时,下面的命令给出了一个404响应:

 curl -k -s -X GET https://username:password@my-docker-registry.com/v1/search 404 page not found curl -k -s -X GET https://username:password@my-docker-registry.com/v2/search 404 page not found root@ip-10-232-0-191:~# docker search username:password@my-docker-registry.com/hello-world FATA[0000] Invalid repository name (admin:admin), only [a-z0-9-_.] are allowed root@ip-10-232-0-191:~# docker search my-docker-registry.com/hello-world FATA[0000] Error response from daemon: Unexpected status code 404 

我想询问是否有人有任何想法,为什么和什么是正确的方式来使用Docker客户端searchregistry的图像。

看看API v2.0文档 ,他们是否只是不支持searchfunction? 看起来有点奇怪,省略这样的function。

至less有一些工作:)

 root@ip-10-232-0-191:~# curl -k -s -X GET https://username:password@my-docker-registry.com/v2/hello-world/tags/list {"name":"hello-world","tags":["latest"]} 

到目前为止 – 从registryv2.0.1缺乏searchAPI,这个问题在这里讨论。 我相信searchAPI是打算在V2.1着陆。

编辑: /v2/catalog endpoint可用于distribution/registry:master

在新的registryAPI之前:

如果您正在使用REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY ,则可以列出该目录的内容

 user@host:~# tree $REGISTRY_FS_ROOTDIR/docker/registry/v2/repositories -L 2 ***/docker/registry/v2/repositories └── repository1 └── image1 

这可能是有用的做一个快速的networking用户可以调用这样做,或者如果你有ssh访问存储仓库的主机:

ssh -T user@host -p <port> tree $REGISTRY_FS_ROOTDIR/docker/registry/ -L 2

看一下在nginx反向代理中部署v1和v2registry的组合示例

可从https://github.com/docker/distribution获得的最新版本的Docker Registry支持Catalog API。 (V2 / _catalog)。 这允许search存储库的能力。

如果有兴趣的话,可以尝试使用docker image registry CLI,以便在新的Docker Registry v2发行版中使用searchfunction:( https://github.com/vivekjuneja/docker_registry_cli

如果你在windows上,这里有一个Powershell脚本,用基本的httpauthentication从windows查询v2/_catalog

https://gist.github.com/so0k/b59382ea7fd959cf7040

仅供参考,使用这个你必须docker pull distribution/registry:master而不是docker pull registry:2registry:2映像版本当前是2.0.1 ,不附带目录端点。