Skip to content

buildctl: define oci-layout flag#3112

Merged
tonistiigi merged 1 commit intomoby:masterfrom
jedevc:oci-layout-buildctl-flag
Sep 14, 2022
Merged

buildctl: define oci-layout flag#3112
tonistiigi merged 1 commit intomoby:masterfrom
jedevc:oci-layout-buildctl-flag

Conversation

@jedevc
Copy link
Copy Markdown
Member

@jedevc jedevc commented Sep 14, 2022

This ensures that the new oci-layout can be loaded using buildctl (see #2827 (comment)).

Example usage:

buildctl --addr tcp://localhost:1234 build \
  --frontend=dockerfile.v0 \
  --local context=. --local dockerfile=. \
  --opt context:foo=oci-layout://foodir@sha256:79a06bdbfbf27b365be61ca38646b07b451681475c284ad79deed506ab192917 \
  --oci-layout foodir=./path/to/oci/dir

Previously, the --oci-layout flag was not registered with cobra, so could not be provided correctly.

CC @deitch @tonistiigi

This ensures that the new oci-layout can be loaded using buildctl.

Signed-off-by: Justin Chadwell <me@jedevc.com>
@tonistiigi tonistiigi merged commit f567525 into moby:master Sep 14, 2022
@deitch
Copy link
Copy Markdown
Contributor

deitch commented Sep 14, 2022

@jedevc so how does this get used from the CLI? Or more specifically, what are the steps I need? It looks like:

  1. Place the context in the Dockerfile, eg. FROM foo or FROM alpine:3.16 as foo
  2. Map the path to a named dir, in your example --oci-layout foodir=./path/to/oci/dir
  3. Map the context from the Dockerfile to the named dir, in your example --opt context:foo=oci-layout://foodir@sha256:79a06bdbfbf27b365be61ca38646b07b451681475c284ad79deed506ab192917

The above 3 steps will map foo to the oci layout named foodir, pulling the specific index/manifest with that hash, and finding foodir by looking up what was in --oci-layout foodir=...

Is that it?

@jedevc jedevc deleted the oci-layout-buildctl-flag branch September 14, 2022 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants