From 4715a7e9e17a6ad6e7a254095845c8b9583e583d Mon Sep 17 00:00:00 2001 From: David Karlsson Date: Wed, 12 Oct 2022 17:15:23 +0200 Subject: [PATCH] docs: fix cache command examples Signed-off-by: David Karlsson --- docs/guides/cache/azblob.md | 4 ++-- docs/guides/cache/gha.md | 16 ++++++++-------- docs/guides/cache/index.md | 20 ++++++++++---------- docs/guides/cache/inline.md | 13 ++++++++----- docs/guides/cache/local.md | 8 ++++---- docs/guides/cache/registry.md | 4 ++-- docs/guides/cache/s3.md | 4 ++-- 7 files changed, 36 insertions(+), 33 deletions(-) diff --git a/docs/guides/cache/azblob.md b/docs/guides/cache/azblob.md index f7d01995..a2430cb9 100644 --- a/docs/guides/cache/azblob.md +++ b/docs/guides/cache/azblob.md @@ -22,9 +22,9 @@ The `azblob` cache store uploads your resulting build cache to ## Synopsis ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=azblob,name=[,parameters...] \ - --cache-from type=azblob,name=[,parameters...] + --cache-from type=azblob,name=[,parameters...] . ``` The following table describes the available CSV parameters that you can pass to diff --git a/docs/guides/cache/gha.md b/docs/guides/cache/gha.md index fa38ffc1..072db488 100644 --- a/docs/guides/cache/gha.md +++ b/docs/guides/cache/gha.md @@ -26,9 +26,9 @@ inside your GitHub action pipelines, as long as your use case falls within the ## Synopsis ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --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 @@ -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): ```console -$ docker buildx build . --push -t / \ - --cache-to 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 / \ - --cache-to type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 - --cache-from type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 +$ docker buildx build --push -t / \ + --cache-to 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 / \ + --cache-to type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 \ + --cache-from type=gha,url=...,token=...,scope=$GITHUB_REF_NAME-image2 . ``` GitHub's diff --git a/docs/guides/cache/index.md b/docs/guides/cache/index.md index 09f7b67f..3825d186 100644 --- a/docs/guides/cache/index.md +++ b/docs/guides/cache/index.md @@ -56,9 +56,9 @@ Example `buildx` command using the `registry` backend, using import and export cache: ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=registry,ref=/[,parameters...] \ - --cache-from type=registry,ref=/[,parameters...] + --cache-from type=registry,ref=/[,parameters...] . ``` > **Warning** @@ -78,10 +78,10 @@ following example shows importing cache from multiple locations using the registry cache backend: ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=registry,ref=/: \ --cache-from type=registry,ref=/: \ - --cache-from type=registry,ref=/:main + --cache-from type=registry,ref=/:main . ``` ## 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: ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=registry,ref=/,mode=max \ - --cache-from type=registry,ref=/ + --cache-from type=registry,ref=/ . ``` 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`: ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=registry,ref=/,compression=zstd \ - --cache-from type=registry,ref=/ + --cache-from type=registry,ref=/ . ``` Use the `compression-level=` 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: ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=registry,ref=/,oci-mediatypes=true \ - --cache-from type=registry,ref=/ + --cache-from type=registry,ref=/ . ``` This property is only meaningful with the `--cache-to` flag. When fetching diff --git a/docs/guides/cache/inline.md b/docs/guides/cache/inline.md index c8004e68..f6ff07d2 100644 --- a/docs/guides/cache/inline.md +++ b/docs/guides/cache/inline.md @@ -11,23 +11,25 @@ want to consider the [registry](./registry.md) cache. ## Synopsis ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=inline \ - --cache-from type=registry,ref=/image + --cache-from type=registry,ref=/image . ``` To export cache using `inline` storage, pass `type=inline` to the `--cache-to` option: ```console -$ docker buildx build . --push -t / --cache-to type=inline +$ docker buildx build --push -t / \ + --cache-to type=inline . ``` Alternatively, you can also export inline cache by setting the build argument `BUILDKIT_INLINE_CACHE=1`, instead of using the `--cache-to` flag: ```console -$ docker buildx build . --push -t / --arg BUILDKIT_INLINE_CACHE=1 +$ docker buildx build --push -t / \ + --arg BUILDKIT_INLINE_CACHE=1 . ``` 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: ```console -$ docker buildx build . --push -t / --cache-from type=registry,ref=/ +$ docker buildx build --push -t / \ + --cache-from type=registry,ref=/ . ``` ## Further reading diff --git a/docs/guides/cache/local.md b/docs/guides/cache/local.md index 64215116..2a84fcc9 100644 --- a/docs/guides/cache/local.md +++ b/docs/guides/cache/local.md @@ -21,9 +21,9 @@ solution. ## Synopsis ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --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 @@ -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: ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --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 diff --git a/docs/guides/cache/registry.md b/docs/guides/cache/registry.md index a2508d3b..5310a52e 100644 --- a/docs/guides/cache/registry.md +++ b/docs/guides/cache/registry.md @@ -29,9 +29,9 @@ Unlike the simpler `inline` cache, the `registry` cache supports several configuration parameters: ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=registry,ref=/[,parameters...] \ - --cache-from type=registry,ref=/ + --cache-from type=registry,ref=/ . ``` The following table describes the available CSV parameters that you can pass to diff --git a/docs/guides/cache/s3.md b/docs/guides/cache/s3.md index 09347900..53048db9 100644 --- a/docs/guides/cache/s3.md +++ b/docs/guides/cache/s3.md @@ -23,9 +23,9 @@ bucket. ## Synopsis ```console -$ docker buildx build . --push -t / \ +$ docker buildx build --push -t / \ --cache-to type=s3,region=,bucket=,name=[,parameters...] \ - --cache-from type=s3,region=,bucket=,name= + --cache-from type=s3,region=,bucket=,name= . ``` The following table describes the available CSV parameters that you can pass to