mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-29 17:05:46 +08:00
docs: update oci layout with tag resolution
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
parent
70682b043e
commit
1885e41789
@ -136,10 +136,12 @@ COPY --from=project myfile /
|
|||||||
|
|
||||||
#### <a name="source-oci-layout"></a> Source image from OCI layout directory
|
#### <a name="source-oci-layout"></a> 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
|
```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:<tag>
|
||||||
|
$ docker buildx build --build-context foo=oci-layout:///path/to/local/layout@sha256:<digest>
|
||||||
```
|
```
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
@ -151,14 +153,8 @@ COPY --from=foo myfile /
|
|||||||
FROM foo
|
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
|
The OCI layout directory must be compliant with the [OCI layout specification](https://github.com/opencontainers/image-spec/blob/main/image-layout.md).
|
||||||
do any form of `image:tag` resolution to find the hash of the manifest; that is up to you.
|
You can reference an image in the layout using either tags, or the exact digest.
|
||||||
|
|
||||||
The format of the `--build-context` must be: `<context>=oci-layout://<path-to-local-layout>@sha256:<hash-of-manifest>`, 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.
|
|
||||||
|
|
||||||
### <a name="builder"></a> Override the configured builder instance (--builder)
|
### <a name="builder"></a> Override the configured builder instance (--builder)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user