edw*_*ean 73 docker docker-registry
我做了一个私人注册表,curl xx.xx.xx.xx:5000没关系.我通过执行以下操作将图像推入docker私有注册表:
docker push xx.xx.xx.xx:5000/centos
它返回:
http://xx.xx.xx.xx:5000/v1/repositories/centos/tags/latest
问题是如何从注册表Web或命令获取所有图像.我无法从docker注册表api中找到任何信息.任何人都有帮助?:)
iTe*_*ech 84
现在,从docker客户端,您只需直接搜索您的私人注册表,而无需使用HTTP API或任何额外的工具:
例如,搜索centos图像:
docker search localhost:5000/centos
小智 70
从私有注册表的 0.7.0版开始,您可以执行以下操作:
$ curl -X GET http://localhost:5000/v1/search?q=postgresql
Run Code Online (Sandbox Code Playgroud)
你会得到一个json有效载荷:
{"num_results": 1, "query": "postgresql", "results": [{"description": "", "name": "library/postgresql"}]}
Run Code Online (Sandbox Code Playgroud)
在这里给出更多背景是我如何开始我的注册表:
docker run \
-e SETTINGS_FLAVOR=local \
-e STORAGE_PATH=/registry \
-e SEARCH_BACKEND=sqlalchemy \
-e LOGLEVEL=DEBUG \
-p 5000:5000 \
registry
Run Code Online (Sandbox Code Playgroud)
snt*_*nth 66
所以我知道这是一个快速变化的领域但是(截至2015-09-08)我在Docker Registry HTTP API V2中发现了以下内容:
GET /v2/_catalog
Run Code Online (Sandbox Code Playgroud)
GET /v2/<name>/tags/list
Run Code Online (Sandbox Code Playgroud)
基于以下内容,我在本地注册表上工作(注册表:2图像ID 1e847b14150e365a95d76a9cc6b71cd67ca89905e3a0400fa44381ecf00890e1创建于2015-08-25T07:55:17.072):
$ curl -X GET http://localhost:5000/v2/_catalog
{"repositories":["ubuntu"]}
$ curl -X GET http://localhost:5000/v2/ubuntu/tags/list
{"name":"ubuntu","tags":["latest"]}
Run Code Online (Sandbox Code Playgroud)
mre*_*mre 16
目前,Docker Registry v2没有搜索支持.
这个主题有一个长期运行的主题.目前的计划是支持最终扩展的搜索,这应该在v2.1之前完成.
作为一种变通方法,执行您的注册表V2正在运行的机器上执行以下操作:
> docker exec -it <your_registry_container_id> bash
> ls /var/lib/registry/docker/registry/v2/repositories/
Run Code Online (Sandbox Code Playgroud)
图像位于与其命名空间相对应的子目录中,例如 jwilder/nginx-proxy
小智 12
能够通过搜索"库"来获取我的私人注册表中的所有内容:
docker search [my.registry.host]:[port]/library
Run Code Online (Sandbox Code Playgroud)
退货(例如):
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
library/custom-image 0
library/another-image 0
library/hello-world 0
Run Code Online (Sandbox Code Playgroud)
小智 6
我安装了atc-/docker-registry-web项目,它给了我UI并搜索我的私有注册表. https://github.com/atc-/docker-registry-web
它是dockerised,你可以运行它
docker run -p 8080:8080 -e REG1=http://registry_host.name:5000/v1/ atcol/docker-registry-ui
并通过浏览查看内容 registry_ui_host.name:8080
列出所有图片
docker search <registry_host>:<registry_port>/
Run Code Online (Sandbox Code Playgroud)
列出类似“ vcs”的图像
docker search <registry_host>:<registry_port>/vcs
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
129052 次 |
| 最近记录: |