我知道可以使用dockerhub
完成此操作。我想知道是否有类似的东西可用于gitlab注册表。
用例是,我编写了一个结构脚本,以将部署还原为用户提供的特定标签。在实际提取图像之前,我想知道注册表中是否存在带有指定标签的图像,并相应地警告用户。
我已经搜索了他们的文档,但找不到任何东西。
注意:这里的用户是部署代码的人。
最佳答案
除非GitLab Container Registry支持kind of curl dockerhub does(带有v1/repositories/$1/tags/$2
),否则我怀疑它是否提供该功能。
例如,issue 26866 "GitLab Registry available images list/search"在10个月后仍处于打开状态。
适用于GitLab 12.2的更新(2019年4月,18个月后)
After working through the implementation, it made sense to create two endpoints:
GET /groups/:id/registry/repositories
- Returns a list of all Docker container repositories for all projects within the group, similar toGET /projects/:id/registry/repositories
and
GET /groups/:id/registry/repositories/tags
- Returns a list of all Docker container repositories for all projects within the group including all tags for each container repository. The response will look something like this:
这样可以帮助检查是否存在
image:tag
。更新GitLab 13.0 (May 2020)
Use search to quickly find and discover images hosted in the GitLab Container Registry
When you or someone on your team publishes an image to the GitLab Container Registry, you need a way to quickly find it and ensure the image was built properly.
If you’re using GitLab CI/CD to publish images with each build, it’s been very difficult to find an image efficiently within the current user interface. Instead, you’ve relied on the command line or the API.We are excited to announce that in 13.0, we’ve added search functionality to the GitLab Container Registry.
Simply navigate to your project or group’s registry and enter an image name to see a list of all your images.
参见documentation和issue。
关于docker - 如何检查图片:tag exists in gitlab container registry,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47660841/