gpt4 book ai didi

docker - 从 docker registry 获取 list 列表(fat manifest)

转载 作者:行者123 更新时间:2023-12-02 18:40:41 25 4
gpt4 key购买 nike

在使用 docker registry API 时,我试图访问 list 列表(又名胖 list ),如 here 所述.

curl 调用的详细信息是:

curl "https://myserver/v2/<repository>/manifests/<version/" -H "Accept: application/vnd.docker.distribution.manifest.list.v2+json"

然而,对此的响应是 schemaVersion 为 1。application/vnd.docker.distribution.manifest.v2+json 的 Accept header 似乎确实获得了 list 的正确版本,但是似乎不适用于列表类型接受 header 。

我是否在 URL 或 header 中遗漏了什么?

最佳答案

您需要使用 application/vnd.docker.distribution.manifest.list.v2+json header 。但是,不能保证注册表会为您提供 list 列表,因此您还必须能够处理普通的图像 list 。

来自docs :

When pulling images, clients indicate support for this new version of the manifest format by sending the application/vnd.docker.distribution.manifest.v2+json and application/vnd.docker.distribution.manifest.list.v2+json media types in an Accept header when making a request to the manifests endpoint. Updated clients should check the Content-Type header to see whether the manifest returned from the endpoint is in the old format, or is an image manifest or manifest list in the new format.

关于docker - 从 docker registry 获取 list 列表(fat manifest),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42707985/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com