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

Curious why --cache-to creates an image index #1007

Closed
mxmeinhold opened this issue Mar 16, 2022 Discussed in #911 · 1 comment
Closed

Curious why --cache-to creates an image index #1007

mxmeinhold opened this issue Mar 16, 2022 Discussed in #911 · 1 comment

Comments

@mxmeinhold
Copy link

Seems the discussion isn't very visible, so promoting this to an issue.
Note that this actually does cause some issues and isn't just me being curious:

  • some registries validate that manifests are spec compliant (particularly GCR out of the ones I've dealt with)
  • tooling trying to pull the index's children tries to get them as manifests (which of course results in errors)

Discussed in #911

Originally posted by mxmeinhold January 11, 2022
I noticed that docker buildx build --cache-to creates a application/vnd.oci.image.index.v1+json at the cache destination.

This struck me as odd, given that the "manifests" referenced by it seem to be pushed as blobs in my testing, and aren't resolvable as manifests in the registry. This results in some broken expectations for client (e.g. crane config tries to fetch one of the "manifests" as a manifest, which of course fails). I would think this could fairly easily translated to an image manifest, since the application/vnd.buildkit.cacheconfig.v0 seems a good candidate for the config field, and the other entries look to already be layer mediatypes.

Is there some restriction that requires cache be pushed as an image index?

Context:

$ docker buildx version
github.com/docker/buildx v0.5.1-docker 11057da37336192bfc57d81e02359ba7ba848e4a

I'm testing with crane version 0.7.0 and manually inspecting resources that --cache-to pushed to a self hosted distribution spec compliant registry using logs and curl.

@tonistiigi
Copy link
Member

moby/buildkit#2251 best place to track this. For the history, you can look at the linked issues from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants