Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot copy buildkit cache images #2210

Open
multun opened this issue Nov 30, 2023 · 2 comments
Open

Cannot copy buildkit cache images #2210

multun opened this issue Nov 30, 2023 · 2 comments
Labels
kind/feature A request for, or a PR adding, new functionality

Comments

@multun
Copy link

multun commented Nov 30, 2023

I've tried copying an image with a manifest with mediaType application/vnd.buildkit.cacheconfig.v0. These images are used by buildkit when caching to a registry, which is the prefered setup.

Reproducer

$ skopeo inspect docker://ghcr.io/osrd-project/unstable/osrd-core:dev-cache
FATA[0000] Error parsing manifest for image: fetching target platform image selected from image index: reading manifest sha256:0bfe9587aa2bf5b903546ccce960c67e492e2991ed1f17f849d31ab9ce90c7ac in ghcr.io/osrd-project/unstable/osrd-core: manifest unknown 

$ skopeo copy docker://ghcr.io/osrd-project/unstable/osrd-core:dev-cache XXXX
[fails with the same error]

Adding --raw to skopeo inspect makes it "work", as skopeo then doesn't need to parse the manifest

@mtrmac
Copy link
Collaborator

mtrmac commented Nov 30, 2023

Thanks for your report.

The title says copy (and that also fails) but the reproducer uses inspect. Which one matters to you?


The manifest structure is

{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:0bfe9587aa2bf5b903546ccce960c67e492e2991ed1f17f849d31ab9ce90c7ac",
            "size": 734,
            "annotations": {
                "buildkit/createdat": "2023-11-29T15:55:24.502779316Z",
                "containerd.io/distribution.source.ghcr.io": "osrd-project/unstable/osrd-core",
                "containerd.io/uncompressed": "sha256:393a68c8324ccea2b51ac02caf3f03f7b906040f8d8c2ffef1cc3bbca4b64acc"
            }
        },

and that’s just invalid. https://github.com/opencontainers/image-spec/blob/main/image-index.md says that the manifests entries must point to manifests, and these are layers.

I’m not saying we must fail handling this, but it’s a new structure not anticipated by the existing code.

@mtrmac mtrmac added the kind/feature A request for, or a PR adding, new functionality label Nov 30, 2023
@multun
Copy link
Author

multun commented Dec 1, 2023

The title says copy (and that also fails) but the reproducer uses inspect. Which one matters to you?

copy is the one I'm interested in, but I figured that making inspect work would probably be one of the intermediary steps in implementing copy support

@mtrmac mtrmac transferred this issue from containers/skopeo Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for, or a PR adding, new functionality
Projects
None yet
Development

No branches or pull requests

2 participants