Skip to content

Load image into buildx builder instance #847

Closed

Description

@leighmcculloch

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.

Activity

  1. crazy-max commented on Nov 18, 2021

    @crazy-max
    Member
  2. zachary-povey commented on Nov 18, 2021

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

  3. leighmcculloch commented on Nov 18, 2021

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

  4. AlekSi commented on Jan 28, 2022

    @AlekSi

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

  5. leighmcculloch commented on Jan 28, 2022

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

  6. AlekSi commented on Jan 28, 2022

    @AlekSi

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

  7. dmadisetti commented on May 2, 2022

    @dmadisetti

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

  8. mathbunnyru commented on May 12, 2022

    @mathbunnyru

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

  9. leighmcculloch commented on Nov 19, 2022

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

  10. mathbunnyru commented on Nov 20, 2022

    @mathbunnyru

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

  11. crazy-max commented on Sep 10, 2026

    @crazy-max
    Member

    oci-layout:// named build contexts (added in v0.9.0, 02bae94) do this without a registry. Export on machine A with docker buildx build -o type=oci,dest=out.tar ., extract the tar, then on machine B run docker buildx build --build-context base=oci-layout:///path/to/layout@sha256:<digest> . (or contexts = { base = "oci-layout://..." } in bake) and reference it with FROM base. See --build-context in https://docs.docker.com/reference/cli/docker/buildx/build/. Consuming the un-extracted tar directly is tracked in #1553.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions