buildx
buildx copied to clipboard
Load image into buildx builder instance
I've built an image using docker buildx build that I exported to a file, and for a subsequent build that's running on another machine I need to import/load that first image into the builder so it has access to it.
As far as I can tell there is no way to tell docker load -i image
to load the image into the buildx builder.
This seems like a missing feature in the buildx functionality that would be valuable for builds that depend on local images that need to be loaded when a registry cannot be used for the intermediary image.
@leighmcculloch https://github.com/docker/buildx/issues/159#issuecomment-539238262
@crazy-max is there any scope for the docker-container
driver supporting building from local images in the future?
By switching to using the docker
driver to achieve this you end up losing support for a bunch of other stuff (multi-arch builds, registry caching).
Thanks @crazy-max. @tonistiigi also discussed with me in the buildkit Slack channel and helped me understand where the capabilities are and aren't. If there's plan to support loading images into buildx builders in the future it'd be great to keep this issue open. Or if that is not part of the plan, please close.
See also #186 (closed, but not resolved) and #430.
@AlekSi I've read the other issues but it is unclear where it's going. Is it closed as won't fix? Just so I understand if this is likely to be something in the future or not. Thanks!
I don't know; I'm just a user with this or a similar problem, doing a cross-linking. :)
This is a bit of an issue for containers built with Nix as well, and makes docker/build-push-action@v2 less than useful
@leighmcculloch could you tell me please, have you found a way to overcome this issue?
I want to do almost the same thing, but between different GitHub jobs. So, one job builds an image, uploads it as an artifact, another job downloads this image and wants to use this image as a base image for another image. @crazy-max maybe you could help me?
@mathbunnyru I found no way to do this with buildx
and it sounded like from discussions on the Docker Slack that there isn't plans to support it.
What I ended up doing was using buildx
for my builds with no dependencies, and then plain old build
for the image build that needed to pull in the others. See here: https://github.com/stellar/quickstart/blob/68fa964e61e58e57fa3d1dd58bc13d4b4ab0633c/.github/workflows/Dockerfile.dev.yml
@mathbunnyru I found no way to do this with
buildx
and it sounded like from discussions on the Docker Slack that there isn't plans to support it.What I ended up doing was using
buildx
for my builds with no dependencies, and then plain oldbuild
for the image build that needed to pull in the others. See here: https://github.com/stellar/quickstart/blob/68fa964e61e58e57fa3d1dd58bc13d4b4ab0633c/.github/workflows/Dockerfile.dev.yml
Got it, thank you. I ended up using ARM runners for GitHub actions and using docker save
and uploading and downloading artifacts. It's a bit slow, but works really well.