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

Load image into buildx builder instance #847

Open
leighmcculloch opened this issue Nov 17, 2021 · 10 comments
Open

Load image into buildx builder instance #847

leighmcculloch opened this issue Nov 17, 2021 · 10 comments

Comments

@leighmcculloch
Copy link

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.

@crazy-max
Copy link
Member

@zachary-povey
Copy link
Contributor

@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).

@leighmcculloch
Copy link
Author

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.

@AlekSi
Copy link

AlekSi commented Jan 28, 2022

See also #186 (closed, but not resolved) and #430.

@leighmcculloch
Copy link
Author

@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!

@AlekSi
Copy link

AlekSi commented Jan 28, 2022

I don't know; I'm just a user with this or a similar problem, doing a cross-linking. :)

@dmadisetti
Copy link

This is a bit of an issue for containers built with Nix as well, and makes docker/build-push-action@v2 less than useful

@mathbunnyru
Copy link

@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?

@leighmcculloch
Copy link
Author

@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
Copy link

@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

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.

riftEmber added a commit to chapel-lang/chapel that referenced this issue Jul 30, 2024
Adjust the nightly Docker testing script to push (and pull) `nightly`
tags of the images.

This incidentally makes the chapel-gasnet and chapel-gasnet-smp images
build off of the just-built Chapel base image. Previously it was
building off of the `latest` tag from the last release, not accessing
the local copy of `latest` due to [behavior of the buildx
builder](docker/buildx#847).

While here, adjust formatting of `util/cron/test-docker.bash` script for
clarity.

Resolves Cray/chapel-private#6436.

[reviewed by @arezaii , thanks!]

Testing:
- [x] manual run succeeds and pushes `nightly` images on chapelmac-m1
- [x] build exits with error if Chapel base image can't build
- [x] (pre-merge reminder) update Dockerhub page to note the meaning of
the `nightly` tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants