From 1885e4178994194105d36e1594bf79e32db9b60d Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Thu, 5 Jan 2023 13:47:04 +0000 Subject: [PATCH] docs: update oci layout with tag resolution Signed-off-by: Justin Chadwell --- docs/reference/buildx_build.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/reference/buildx_build.md b/docs/reference/buildx_build.md index ebc02a4d..91d4ab43 100644 --- a/docs/reference/buildx_build.md +++ b/docs/reference/buildx_build.md @@ -136,10 +136,12 @@ COPY --from=project myfile / #### Source image from OCI layout directory -Source an image from a local [OCI layout compliant directory](https://github.com/opencontainers/image-spec/blob/main/image-layout.md): +Source an image from a local [OCI layout compliant directory](https://github.com/opencontainers/image-spec/blob/main/image-layout.md), +either by tag, or by digest: ```console -$ docker buildx build --build-context foo=oci-layout:///path/to/local/layout@sha256:abcd12345 . +$ docker buildx build --build-context foo=oci-layout:///path/to/local/layout: +$ docker buildx build --build-context foo=oci-layout:///path/to/local/layout@sha256: ``` ```dockerfile @@ -151,14 +153,8 @@ COPY --from=foo myfile / FROM foo ``` -The OCI layout directory must be compliant with the [OCI layout specification](https://github.com/opencontainers/image-spec/blob/main/image-layout.md). It looks _solely_ for hashes. It does not -do any form of `image:tag` resolution to find the hash of the manifest; that is up to you. - -The format of the `--build-context` must be: `=oci-layout://@sha256:`, where: - -* `context` is the name of the build context as used in the `Dockerfile`. -* `path-to-local-layout` is the path on the local machine, where you are running `docker build`, to the spec-compliant OCI layout. -* `hash-of-manifest` is the hash of the manifest for the image. It can be a single-architecture manifest or a multi-architecture index. +The OCI layout directory must be compliant with the [OCI layout specification](https://github.com/opencontainers/image-spec/blob/main/image-layout.md). +You can reference an image in the layout using either tags, or the exact digest. ### Override the configured builder instance (--builder)