Skip to content
New issue

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

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

Already on GitHub? # to your account

Feature Request: --load equivalent for the OCI exporter #1522

Closed
TBBle opened this issue Jan 16, 2023 · 0 comments · Fixed by #1813
Closed

Feature Request: --load equivalent for the OCI exporter #1522

TBBle opened this issue Jan 16, 2023 · 0 comments · Fixed by #1813

Comments

@TBBle
Copy link

TBBle commented Jan 16, 2023

This use-case is driven by the Docker containerd image-store beta, see docker/roadmap#371 (comment) for the initial failure case, and then a bunch more messages after for detailed dives, if the below description is insufficient.


Currently --load is equivalent to --output=type=docker,dest=, which triggers a special code-path in buildx to receive the image back from BuildKit as a tar stream, and pass it into the moral equivalent of docker load.

The containerd image-store beta enables multi-platform builds, which produce a manifest list (or image index in OCI terms) ,which the docker exporter cannot handle.

Some testing shows that the OCI equivalent of --load, i.e. --output=type=oci,dest= fails with the following error:

ERROR: failed to solve: method /moby.filesync.v1.FileSend/diffcopy not supported by the client

As far as I can guess (which is why I'm posting it here) this is due to the magic used for the docker exporter not being hooked up for the oci exporter.

However, I haven't tested that this magic would be sufficient. I haven't actually worked out (from GitHub browsing) how adding that output writer leads to another protobuf method being registered on the client. And I'm also guessing that buildx is the client-in-question here.

I have noted that in the single-platform case, --output=type=docker,dest= works identically to --load (as documented, --load is a trivial alias), and --output=type=oci,dest= fails the same way, so this is not manifest-list specific.

I have also noted that --output=type=oci,dest=somefile.tar in both single-platform and multi-platform mode produces a file that is usable with docker load -i, which suggests that everything is fine in both BuildKit and Docker for this data-flow. (--output=type=oci can be piped directly into docker load under WSL2, but on Windows native consoles (PowerShell and git bash) that's getting intermingled progress output for some reason. That's a different issue though.)

So there's really two requests here:

  • Make --output=type=oci,dest= work like --output=type=docker,dest=, i.e. loading into a Docker instance.
  • Somehow make that shorter to type, e.g., --load-oci or something not-ugly. Or even make --load an alias for --output=type=oci,dest= instead, perhaps just in multi-platform mode?

Sorry if this is a duplicate, I couldn't find a tracking ticket for this use-case in any of the three repos (moby, buildkit, or here), and have ended up generating a lot of noise in docker/roadmap#371 instead.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant