简体   繁体   English

JFrog Artifactory 错误:将具有清单 v2 模式 1 的 Docker 图像推送到此存储库被阻止

[英]JFrog Artifactory error: Pushing Docker images with manifest v2 schema 1 to this repository is blocked

I have two docker repositories running on the same JFrog cloud account/instance.我有两个 docker 存储库在同一个 JFrog 云帐户/实例上运行。 One for internal release candidates and the other for potentially external GC releases.一个用于内部候选版本,另一个用于潜在的外部 GC 版本。 I want to be able to build the docker images and push to the internal repository, let QA/UAT go to town, and then copy the image to the release repository.我希望能够构建 docker 图像并推送到内部存储库,让 QA/UAT go 到城镇,然后将图像复制到发布存储库。 I don't want to rebuild the image from source.不想从源代码重建图像。 Unfortunately, when I try to pull, tag and then push the image, I'm getting an error:不幸的是,当我尝试拉取、标记然后推送图像时,出现错误:

unauthorized: Pushing Docker images with manifest v2 schema 1 to this repository is blocked.未经授权:将具有清单 v2 模式 1 的 Docker 图像推送到此存储库被阻止。

Both repositories block schema 1 manifests, but I am pushing fine to the internal repository, so it doesn't make much sense I wouldn't be able to push the same image to the release repository.两个存储库都阻止模式 1 清单,但我正在将其推送到内部存储库,因此我无法将相同的图像推送到发布存储库并没有多大意义。

I've setup a pretty simple test to confirm (actual repository URLs censored):我设置了一个非常简单的测试来确认(实际存储库 URL 被审查):

% docker pull hello-world:latest
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
...
% docker tag hello-world:latest internal-rc.jfrog.io/hello-world:1.0.0-beta
% docker push internal-rc.jfrog.io/hello-world:1.0.0-beta
The push refers to repository [internal-rc.jfrog.io/hello-world]
9c27e219663c: Pushed
...
% docker system prune -a
...
Total reclaimed space: 131.8MB
% docker image pull internal-rc.jfrog.io/hello-world:1.0.0-beta
1.0.0-beta: Pulling from hello-world
0e03bdcc26d7: Pull complete
...
% docker image tag internal-rc.jfrog.io/hello-world:1.0.0-beta docker-release.jfrog.io/hello-world:1.0.0
% docker image push docker-release.jfrog.io/hello-world:1.0.0
The push refers to repository [docker-release.jfrog.io/hello-world]
9c27e219663c: Layer already exists
[DEPRECATION NOTICE] registry v2 schema1 support will be removed in an upcoming release. Please contact admins of the docker-release.jfrog.io registry NOW to avoid future disruption. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/
unauthorized: Pushing Docker images with manifest v2 schema 1 to this repository is blocked. For more information visit https://www.jfrog.com/confluence/display/RTF/Advanced+Topics#AdvancedTopics-DockerManifestV2Schema1Deprecation

So I can upload the image fine to the first repository, and confirm that it is using schema 2:所以我可以将图片上传到第一个存储库,并确认它使用的是模式 2:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "size": 7004,
    "digest": "sha256:66f750f4871ba45724699d7341ee7135caba46f63fb205351197464a66b55eff"
...

Does that mediaType being v1 matter?那个mediaType是 v1 重要吗? It seems like the manifest itself is version 2... But I don't know how I would change that, or why it would be allowed in one repository but not the other.清单本身似乎是第 2 版......但我不知道我将如何更改它,或者为什么它会被允许在一个存储库中而不是另一个存储库中。

I'm using I believe the latest version of docker Docker version 19.03.8, build afacb8b我正在使用我相信最新版本的 docker Docker version 19.03.8, build afacb8b

Anyone have any idea what's going on there?有人知道那里发生了什么吗? Is the schema version being changed between when I upload it the first time and when I download it?架构版本在我第一次上传和下载之间是否发生了变化? Or is it when I tag it or upload it the second time?还是当我标记它或第二次上传它时?

The root of this problem can probably be classified as user error.这个问题的根源大概可以归类为用户错误。 Specifically the user I'm using somehow had permissions removed from the release repository.具体来说,我正在使用的用户以某种方式从发布存储库中删除了权限。 Once that was restored everything works as expected.一旦恢复,一切都会按预期工作。

I say "probably" because the error message has nothing to do with the actual problem, and cost me 2-3 hours worth of wild goose chasing.我说“可能”是因为错误消息与实际问题无关,并且花了我 2-3 个小时的时间去追逐野鹅。

So... If you see this error, go ahead and double check everything else around permissions/access before trying to figure out if there's something actually wrong with your image schema version.所以...如果您看到此错误,请提前 go 并仔细检查权限/访问权限周围的所有其他内容,然后再尝试确定您的图像架构版本是否存在问题。

We had a different case today with a similar error.我们今天有一个不同的案例,有类似的错误。 I'm adding here because this is the top google result at the moment.我在这里添加是因为这是目前谷歌的最高结果。

Pulling Docker images with manifest v2 schema 1 to this repository is blocked.将具有清单 v2 模式 1 的Docker映像拉到此存储库被阻止。

The fix was to change a setting on the remote repository.修复是更改远程存储库上的设置。

Via UI: Artifactory Admin -> Repositories -> Repositories -> Remote tab通过 UI:Artifactory Admin -> Repositories -> Repositories -> Remote 选项卡

Then select your Docker Hub repo, whatever you named it, then under Basic settings -> Docker Settings, uncheck the checkbox labeled然后 select 你的 Docker 集线器仓库,无论你命名它,然后在基本设置 - > Docker 设置下,取消选中标记为的复选框

Block pulling of image manifest v2 schema 1图像清单 v2 模式 1 的块拉取

After that our images began pulling properly again.之后,我们的图像再次开始正常拉动。

There is a similar checkbox on local repos for pushing.本地 repos 上有一个类似的复选框用于推送。

For what it's worth, we're on Artifactory version 7.18.5 rev 71805900对于它的价值,我们使用的是 Artifactory 版本7.18.5 rev 71805900

edit: The surprisingness of our particular issue is (potentially) explained in some more detail here: https://www.jfrog.com/jira/browse/RTFACT-2591编辑:我们的特定问题的令人惊讶的是(可能)在此处更详细地解释: https://www.jfrog.com/jira/browse/RTFACT-2591

Docker pull requests fail due to a change in Docker Hub behavior.由于 Docker 集线器行为的变化,Docker 拉取请求失败。 Now Docker Hub HTTP response headers return in lower case, for example, 'content-type' instead of 'Content-Type', causing Artifactory to fail to download and cache Docker images from Docker Hub. Now Docker Hub HTTP response headers return in lower case, for example, 'content-type' instead of 'Content-Type', causing Artifactory to fail to download and cache Docker images from Docker Hub.

but we have not yet tested whether an upgrade allows us to re-enable the aforementioned checkbox.但我们尚未测试升级是否允许我们重新启用上述复选框。

I have been getting the below errors while either pulling or pushing docker images from build servers.从构建服务器拉取或推送 docker 映像时,我遇到了以下错误。 i have a proxy in env which used to connect docker registry.我在 env 中有一个代理,用于连接 docker 注册表。 My DNS server while resolving the proxy FQDN it was returning a non functional IP-address.我的 DNS 服务器在解析代理 FQDN 时返回了一个不起作用的 IP 地址。 i have 4 DNS servers and multiple proxy servers based on region.我有 4 个 DNS 服务器和多个基于区域的代理服务器。 Once DNS is updated and working/functional proxy returned it started working.一旦 DNS 更新并返回工作/功能代理,它就开始工作。 Just check on network side too, it may solve the issue.也检查一下网络侧,它可能会解决问题。 the error messages were misleading initially i though to be docker layer issue, credential issue..but no network issue.错误消息最初是误导性的,我虽然是 docker 层问题,凭据问题..但没有网络问题。 for the below errors对于以下错误

error pulling image configuration: unknown blob or拉取图像配置时出错:未知 blob 或

[DEPRECATION NOTICE] registry v2 schema1 support will be removed in an upcoming release. [弃用通知] registry v2 schema1 支持将在即将发布的版本中删除。 Please contact admins of the docker registry NOW to avoid future disruption.请立即联系 docker 注册表的管理员,以避免将来出现中断。 More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/ manifest invalid: manifest invalid.更多信息在https://docs.docker.com/registry/spec/deprecated-schema-v1/清单无效:清单无效。 Will start No.6 try.将开始No.6尝试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM