You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/advanced/cache.md
+27-20
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,14 @@
6
6
*[Cache backend API](#cache-backend-api)
7
7
*[Local cache](#local-cache)
8
8
9
-
> More info about cache on [BuildKit](https://github.com/moby/buildkit#export-cache) and [Buildx](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#cache-from) repositories.
9
+
> **Note**
10
+
>
11
+
> See [our guide](https://github.com/docker/buildx/blob/master/docs/guides/cache/index.md)
12
+
> for more details about cache storage backends.
10
13
11
14
## Inline cache
12
15
13
-
In most cases you want to use the [`type=inline` cache exporter](https://github.com/moby/buildkit#inline-push-image-and-cache-together).
16
+
In most cases you want to use the [`type=inline` cache exporter](https://github.com/docker/buildx/blob/master/docs/guides/cache/inline.md).
14
17
However, note that the `inline` cache exporter only supports `min` cache mode. To enable `max` cache mode, push the
15
18
image and the cache separately by using the `registry` cache exporter as shown in the [next example](#registry-cache).
16
19
@@ -33,7 +36,7 @@ jobs:
33
36
name: Set up Docker Buildx
34
37
uses: docker/setup-buildx-action@v2
35
38
-
36
-
name: Login to DockerHub
39
+
name: Login to Docker Hub
37
40
uses: docker/login-action@v2
38
41
with:
39
42
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -52,7 +55,7 @@ jobs:
52
55
## Registry cache
53
56
54
57
You can import/export cache from a cache manifest or (special) image configuration on the registry with the
> :test_tube: This cache exporter is considered EXPERIMENTAL until further notice. Please provide feedback on
97
-
> [BuildKit repository](https://github.com/moby/buildkit) if you encounter any issues.
98
-
99
-
Since [buildx 0.6.0](https://github.com/docker/buildx/releases/tag/v0.6.0) and [BuildKit 0.9.0](https://github.com/moby/buildkit/releases/tag/v0.9.0),
100
-
you can use the [`type=gha` cache exporter](https://github.com/moby/buildkit/tree/master#github-actions-cache-experimental).
101
-
102
-
GitHub Actions cache exporter backend uses the [GitHub Cache API](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md)
103
-
to fetch and upload cache blobs. That's why this type of cache should be exclusively used in a GitHub Action workflow
104
-
as the `url` (`$ACTIONS_CACHE_URL`) and `token` (`$ACTIONS_RUNTIME_TOKEN`) attributes are populated when a workflow
99
+
> **Warning**
100
+
>
101
+
> This cache exporter is considered EXPERIMENTAL until further notice. Please
102
+
> provide feedback on [BuildKit repository](https://github.com/moby/buildkit)
backend uses the [GitHub Cache API](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md)
107
+
to fetch and upload cache blobs. That's why this type of cache should be
108
+
exclusively used in a GitHub Action workflow as the `url` (`$ACTIONS_CACHE_URL`)
109
+
and `token` (`$ACTIONS_RUNTIME_TOKEN`) attributes are populated when a workflow
105
110
is started.
106
111
107
112
```yaml
@@ -123,7 +128,7 @@ jobs:
123
128
name: Set up Docker Buildx
124
129
uses: docker/setup-buildx-action@v2
125
130
-
126
-
name: Login to DockerHub
131
+
name: Login to Docker Hub
127
132
uses: docker/login-action@v2
128
133
with:
129
134
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -141,11 +146,13 @@ jobs:
141
146
142
147
### Local cache
143
148
144
-
> :warning: At the moment caches are copied over the existing cache so it [keeps growing](https://github.com/docker/build-push-action/issues/252).
145
-
> The `Move cache` step is used as a temporary fix (see https://github.com/moby/buildkit/issues/1896).
149
+
> **Warning**
150
+
>
151
+
> At the moment caches are copied over the existing cache, so it [keeps growing](https://github.com/docker/build-push-action/issues/252).
152
+
> The `Move cache` step is used as a workaround (see [moby/buildkit#1896](https://github.com/moby/buildkit/issues/1896) for more info).
146
153
147
-
You can also leverage [GitHub cache](https://docs.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows)
148
-
using [actions/cache](https://github.com/actions/cache) and [`type=local` cache exporter](https://github.com/moby/buildkit#local-directory-1)
154
+
You can also leverage [GitHub cache](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
155
+
using the [actions/cache](https://github.com/actions/cache) and [`type=local` cache exporter](https://github.com/docker/buildx/blob/master/docs/guides/cache/local.md)
Copy file name to clipboardexpand all lines: docs/advanced/multi-platform.md
+9-5
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,14 @@
1
1
# Multi-platform image
2
2
3
-
You can build multi-platform images using the [`platforms` input](../../README.md#inputs) as described below.
3
+
You can build [multi-platform images](https://docs.docker.com/build/building/multi-platform/)
4
+
using the [`platforms` input](../../README.md#inputs) as described below.
4
5
5
-
> :bulb: List of available platforms will be displayed and available through our [setup-buildx](https://github.com/docker/setup-buildx-action#about) action.
6
-
7
-
> :bulb: If you want support for more platforms, you can use QEMU with our [setup-qemu](https://github.com/docker/setup-qemu-action) action.
6
+
> **Note**
7
+
>
8
+
> * List of available platforms will be displayed and available through our
Copy file name to clipboardexpand all lines: docs/advanced/secrets.md
+21-17
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,19 @@
1
1
# Secrets
2
2
3
-
In the following example we will expose and use the [GITHUB_TOKEN secret](https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret)
3
+
In the following example we will expose and use the [GITHUB_TOKEN secret](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)
4
4
as provided by GitHub in your workflow.
5
5
6
6
First let's create our `Dockerfile` to use our secret:
7
7
8
-
```Dockerfile
9
-
#syntax=docker/dockerfile:1.2
10
-
8
+
```dockerfile
9
+
# syntax=docker/dockerfile:1
11
10
FROM alpine
12
11
RUN --mount=type=secret,id=github_token \
13
12
cat /run/secrets/github_token
14
13
```
15
14
16
-
As you can see we have named our secret `github_token`. Here is the workflow you can use to expose this secret using
17
-
the [`secrets` input](../../README.md#inputs):
15
+
As you can see we have named our secret `github_token`. Here is the workflow
16
+
you can use to expose this secret using the [`secrets` input](../../README.md#inputs):
18
17
19
18
```yaml
20
19
name: ci
@@ -48,14 +47,17 @@ jobs:
48
47
"github_token=${{ secrets.GITHUB_TOKEN }}"
49
48
```
50
49
51
-
> :bulb: You can also expose a secret file to the build with [`secret-files`](../../README.md#inputs) input:
50
+
> **Note**
51
+
>
52
+
> You can also expose a secret file to the build with the [`secret-files`](../../README.md#inputs) input:
52
53
> ```yaml
53
54
> secret-files: |
54
55
> "MY_SECRET=./secret.txt"
55
56
> ```
56
57
57
-
If you're using [GitHub secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) and need to handle
58
-
multi-line value, you will need to place the key-value pair between quotes:
58
+
If you're using [GitHub secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
59
+
and need to handle multi-line value, you will need to place the key-value pair
Copy file name to clipboardexpand all lines: docs/advanced/share-image-jobs.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
# Share built image between jobs
2
2
3
-
As each job is isolated in its own runner you cannot use your built image between jobs (except for [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners)).
4
-
However, you can [pass data between jobs in a workflow](https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts#passing-data-between-jobs-in-a-workflow)
5
-
using the [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact)
3
+
As each job is isolated in its own runner you cannot use your built image
4
+
between jobs (except for [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners)).
5
+
However, you can [pass data between jobs in a workflow](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#passing-data-between-jobs-in-a-workflow)
6
+
using the [actions/upload-artifact](https://github.com/actions/upload-artifact)
7
+
and [actions/download-artifact](https://github.com/actions/download-artifact)
Copy file name to clipboardexpand all lines: docs/advanced/tags-labels.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
# Handle tags and labels
2
2
3
3
If you want an "automatic" tag management and [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)
4
-
for labels, you can do it in a dedicated step. The following workflow will use the [Docker metadata action](https://github.com/docker/metadata-action)
5
-
to handle tags and labels based on GitHub actions events and Git metadata.
4
+
for labels, you can do it in a dedicated step. The following workflow will use
5
+
the [Docker metadata action](https://github.com/docker/metadata-action) to
6
+
handle tags and labels based on GitHub actions events and Git metadata:
0 commit comments