Skip to content

Buildx imagetools create should allow reading content from oci-layout:// directories #1915

Description

@jedevc

Description

Would resolve #1152.

Essentially, it's becoming more common for users to want to export their images, and then push them later. There's a few legitimate reasons to want to do this:

  • Import the image into docker, and run validation tests on it before pushing
  • Manually verify image attestations like SBOMs, Provenance before pushing
  • Split out the build and push sections of a push to allow more manual control over flaky registries

So a workflow something like:

$ docker buildx build -t myorg/myimage --push .

Could be broken down into:

$ docker buildx build --output type=oci,dest=./my-image,tar=false
...
$ docker buildx imagetools create -t myorg/myimage oci-layout://my-image

The reason for using the oci-layout URL schema is just since BuildKit already uses this for overriding named contexts, so it would be good to stick with that.

If we choose to go that way, we should probably also support the docker-image:// schema (the default, for consistency) from https://github.com/moby/buildkit/blob/23d38a7220bff812b8a1de07c1f02b4e46cacd7c/frontend/dockerui/namedcontext.go#L40. Supporting any of the other schemas is probably not a great idea, since 1. it doesn't make a huge amount of sense, and 2. we can't really reuse any of the frontend side code for this anyways.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions