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

buildctl: define oci-layout flag #3112

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

jedevc
Copy link
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
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.

None yet

3 participants