From a8be6b576bdc9acf0875ee70ef136ee4e2e1b3b5 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 020e4535..b26154dc 100644 --- a/docs/reference/buildx_build.md +++ b/docs/reference/buildx_build.md @@ -139,10 +139,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 @@ -154,14 +156,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)