docs: fix cache command examples

Signed-off-by: David Karlsson <david.karlsson@docker.com>
pull/1354/head
David Karlsson 2 years ago
parent c5aec243c9
commit 4715a7e9e1

@ -22,9 +22,9 @@ The `azblob` cache store uploads your resulting build cache to
## Synopsis ## Synopsis
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=azblob,name=<cache-image>[,parameters...] \ --cache-to type=azblob,name=<cache-image>[,parameters...] \
--cache-from type=azblob,name=<cache-image>[,parameters...] --cache-from type=azblob,name=<cache-image>[,parameters...] .
``` ```
The following table describes the available CSV parameters that you can pass to The following table describes the available CSV parameters that you can pass to

@ -26,9 +26,9 @@ inside your GitHub action pipelines, as long as your use case falls within the
## Synopsis ## Synopsis
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=gha[,parameters...] \ --cache-to type=gha[,parameters...] \
--cache-from type=gha[,parameters...] --cache-from type=gha[,parameters...] .
``` ```
The following table describes the available CSV parameters that you can pass to The following table describes the available CSV parameters that you can pass to
@ -67,12 +67,12 @@ example, the cache is set to a combination of the branch name and the image
name, to ensure each branch gets its own cache): name, to ensure each branch gets its own cache):
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image --cache-to type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image \
--cache-from type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image --cache-from type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image .
$ docker buildx build . --push -t <registry>/<image2> \ $ docker buildx build --push -t <registry>/<image2> \
--cache-to type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 --cache-to type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 \
--cache-from type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 --cache-from type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 .
``` ```
GitHub's GitHub's

@ -56,9 +56,9 @@ Example `buildx` command using the `registry` backend, using import and export
cache: cache:
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=registry,ref=<registry>/<cache-image>[,parameters...] \ --cache-to type=registry,ref=<registry>/<cache-image>[,parameters...] \
--cache-from type=registry,ref=<registry>/<cache-image>[,parameters...] --cache-from type=registry,ref=<registry>/<cache-image>[,parameters...] .
``` ```
> **Warning** > **Warning**
@ -78,10 +78,10 @@ following example shows importing cache from multiple locations using the
registry cache backend: registry cache backend:
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=registry,ref=<registry>/<cache-image>:<branch> \ --cache-to type=registry,ref=<registry>/<cache-image>:<branch> \
--cache-from type=registry,ref=<registry>/<cache-image>:<branch> \ --cache-from type=registry,ref=<registry>/<cache-image>:<branch> \
--cache-from type=registry,ref=<registry>/<cache-image>:main --cache-from type=registry,ref=<registry>/<cache-image>:main .
``` ```
## Configuration options ## Configuration options
@ -109,9 +109,9 @@ Mode can be set to either of two options: `mode=min` or `mode=max`. For example,
to build the cache with `mode=max` with the registry backend: to build the cache with `mode=max` with the registry backend:
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=registry,ref=<registry>/<cache-image>,mode=max \ --cache-to type=registry,ref=<registry>/<cache-image>,mode=max \
--cache-from type=registry,ref=<registry>/<cache-image> --cache-from type=registry,ref=<registry>/<cache-image> .
``` ```
This option is only set when exporting a cache, using `--cache-to`. When This option is only set when exporting a cache, using `--cache-to`. When
@ -140,9 +140,9 @@ To select the compression algorithm, you can use the
cache with `compression=zstd`: cache with `compression=zstd`:
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=registry,ref=<registry>/<cache-image>,compression=zstd \ --cache-to type=registry,ref=<registry>/<cache-image>,compression=zstd \
--cache-from type=registry,ref=<registry>/<cache-image> --cache-from type=registry,ref=<registry>/<cache-image> .
``` ```
Use the `compression-level=<value>` option alongside the `compression` parameter Use the `compression-level=<value>` option alongside the `compression` parameter
@ -172,9 +172,9 @@ images with Docker media types or with OCI media types. To export OCI media type
cache, use the `oci-mediatypes` property: cache, use the `oci-mediatypes` property:
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=registry,ref=<registry>/<cache-image>,oci-mediatypes=true \ --cache-to type=registry,ref=<registry>/<cache-image>,oci-mediatypes=true \
--cache-from type=registry,ref=<registry>/<cache-image> --cache-from type=registry,ref=<registry>/<cache-image> .
``` ```
This property is only meaningful with the `--cache-to` flag. When fetching This property is only meaningful with the `--cache-to` flag. When fetching

@ -11,23 +11,25 @@ want to consider the [registry](./registry.md) cache.
## Synopsis ## Synopsis
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=inline \ --cache-to type=inline \
--cache-from type=registry,ref=<registry>/image --cache-from type=registry,ref=<registry>/image .
``` ```
To export cache using `inline` storage, pass `type=inline` to the `--cache-to` To export cache using `inline` storage, pass `type=inline` to the `--cache-to`
option: option:
```console ```console
$ docker buildx build . --push -t <registry>/<image> --cache-to type=inline $ docker buildx build --push -t <registry>/<image> \
--cache-to type=inline .
``` ```
Alternatively, you can also export inline cache by setting the build argument Alternatively, you can also export inline cache by setting the build argument
`BUILDKIT_INLINE_CACHE=1`, instead of using the `--cache-to` flag: `BUILDKIT_INLINE_CACHE=1`, instead of using the `--cache-to` flag:
```console ```console
$ docker buildx build . --push -t <registry>/<image> --arg BUILDKIT_INLINE_CACHE=1 $ docker buildx build --push -t <registry>/<image> \
--arg BUILDKIT_INLINE_CACHE=1 .
``` ```
To import the resulting cache on a future build, pass `type=registry` to To import the resulting cache on a future build, pass `type=registry` to
@ -35,7 +37,8 @@ To import the resulting cache on a future build, pass `type=registry` to
the specified registry: the specified registry:
```console ```console
$ docker buildx build . --push -t <registry>/<image> --cache-from type=registry,ref=<registry>/<image> $ docker buildx build --push -t <registry>/<image> \
--cache-from type=registry,ref=<registry>/<image> .
``` ```
## Further reading ## Further reading

@ -21,9 +21,9 @@ solution.
## Synopsis ## Synopsis
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=local,dest=path/to/local/dir[,parameters...] \ --cache-to type=local,dest=path/to/local/dir[,parameters...] \
--cache-from type=local,src=path/to/local/dir, --cache-from type=local,src=path/to/local/dir .
``` ```
The following table describes the available CSV parameters that you can pass to The following table describes the available CSV parameters that you can pass to
@ -88,9 +88,9 @@ When importing cache using `--cache-to`, you can specify the `digest` parameter
to force loading an older version of the cache, for example: to force loading an older version of the cache, for example:
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=local,dest=path/to/local/dir \ --cache-to type=local,dest=path/to/local/dir \
--cache-from type=local,ref=path/to/local/dir,digest=sha256:6982c70595cb91769f61cd1e064cf5f41d5357387bab6b18c0164c5f98c1f707 --cache-from type=local,ref=path/to/local/dir,digest=sha256:6982c70595cb91769f61cd1e064cf5f41d5357387bab6b18c0164c5f98c1f707 .
``` ```
## Further reading ## Further reading

@ -29,9 +29,9 @@ Unlike the simpler `inline` cache, the `registry` cache supports several
configuration parameters: configuration parameters:
```console ```console
$ docker buildx build . --push -t <registry>/<image> \ $ docker buildx build --push -t <registry>/<image> \
--cache-to type=registry,ref=<registry>/<cache-image>[,parameters...] \ --cache-to type=registry,ref=<registry>/<cache-image>[,parameters...] \
--cache-from type=registry,ref=<registry>/<cache-image> --cache-from type=registry,ref=<registry>/<cache-image> .
``` ```
The following table describes the available CSV parameters that you can pass to The following table describes the available CSV parameters that you can pass to

@ -23,9 +23,9 @@ bucket.
## Synopsis ## Synopsis
```console ```console
$ docker buildx build . --push -t <user>/<image> \ $ docker buildx build --push -t <user>/<image> \
--cache-to type=s3,region=<region>,bucket=<bucket>,name=<cache-image>[,parameters...] \ --cache-to type=s3,region=<region>,bucket=<bucket>,name=<cache-image>[,parameters...] \
--cache-from type=s3,region=<region>,bucket=<bucket>,name=<cache-image> --cache-from type=s3,region=<region>,bucket=<bucket>,name=<cache-image> .
``` ```
The following table describes the available CSV parameters that you can pass to The following table describes the available CSV parameters that you can pass to

Loading…
Cancel
Save