Skip to content

Commit 871b930

Browse files
committed
docs: update links and layout
Signed-off-by: CrazyMax <[email protected]>
1 parent 105bf59 commit 871b930

22 files changed

+155
-138
lines changed

README.md

+58-65
Large diffs are not rendered by default.

TROUBLESHOOTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ While pushing to a registry, you may encounter these kinds of issues:
1616
* `unexpected response: 401 Unauthorized`
1717

1818
These issues are not directly related to this action but are rather linked to
19-
[buildx](https://github.com/docker/buildx), [buildkit](https://github.com/moby/buildkit),
19+
[Buildx](https://github.com/docker/buildx), [BuildKit](https://github.com/moby/buildkit),
2020
[containerd](https://github.com/containerd/containerd) or the registry on which
2121
you're pushing your image. The quality of error message depends on the registry
2222
and are usually not very informative.
@@ -29,7 +29,7 @@ action step and attach BuildKit container logs to your issue.
2929
### With containerd
3030

3131
Next you can test pushing with [containerd action](https://github.com/crazy-max/ghaction-setup-containerd)
32-
using the following workflow. If it works then open an issue on [buildkit](https://github.com/moby/buildkit)
32+
using the following workflow. If it works then open an issue on [BuildKit](https://github.com/moby/buildkit)
3333
repository.
3434

3535
```yaml

dev.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# syntax=docker/dockerfile:1.4
1+
# syntax=docker/dockerfile:1
22

33
ARG NODE_VERSION=16
44
ARG DOCKER_VERSION=20.10.13

docs/advanced/cache.md

+27-20
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
* [Cache backend API](#cache-backend-api)
77
* [Local cache](#local-cache)
88

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.
1013
1114
## Inline cache
1215

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).
1417
However, note that the `inline` cache exporter only supports `min` cache mode. To enable `max` cache mode, push the
1518
image and the cache separately by using the `registry` cache exporter as shown in the [next example](#registry-cache).
1619

@@ -33,7 +36,7 @@ jobs:
3336
name: Set up Docker Buildx
3437
uses: docker/setup-buildx-action@v2
3538
-
36-
name: Login to DockerHub
39+
name: Login to Docker Hub
3740
uses: docker/login-action@v2
3841
with:
3942
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -52,7 +55,7 @@ jobs:
5255
## Registry cache
5356
5457
You can import/export cache from a cache manifest or (special) image configuration on the registry with the
55-
[`type=registry` cache exporter](https://github.com/moby/buildkit/tree/master#registry-push-image-and-cache-separately).
58+
[`type=registry` cache exporter](https://github.com/docker/buildx/blob/master/docs/guides/cache/registry.md).
5659

5760
```yaml
5861
name: ci
@@ -73,7 +76,7 @@ jobs:
7376
name: Set up Docker Buildx
7477
uses: docker/setup-buildx-action@v2
7578
-
76-
name: Login to DockerHub
79+
name: Login to Docker Hub
7780
uses: docker/login-action@v2
7881
with:
7982
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -93,15 +96,17 @@ jobs:
9396

9497
### Cache backend API
9598

96-
> :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)
103+
> if you encounter any issues.
104+
105+
[GitHub Actions cache exporter](https://github.com/docker/buildx/blob/master/docs/guides/cache/gha.md)
106+
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
105110
is started.
106111

107112
```yaml
@@ -123,7 +128,7 @@ jobs:
123128
name: Set up Docker Buildx
124129
uses: docker/setup-buildx-action@v2
125130
-
126-
name: Login to DockerHub
131+
name: Login to Docker Hub
127132
uses: docker/login-action@v2
128133
with:
129134
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -141,11 +146,13 @@ jobs:
141146

142147
### Local cache
143148

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).
146153

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)
149156
with this action:
150157

151158
```yaml
@@ -175,7 +182,7 @@ jobs:
175182
restore-keys: |
176183
${{ runner.os }}-buildx-
177184
-
178-
name: Login to DockerHub
185+
name: Login to Docker Hub
179186
uses: docker/login-action@v2
180187
with:
181188
username: ${{ secrets.DOCKERHUB_USERNAME }}

docs/advanced/dockerhub-desc.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Update DockerHub repo description
1+
# Update Docker Hub repo description
22

3-
You can update the [DockerHub repository description](https://docs.docker.com/docker-hub/repos/) using
4-
a third party action called [DockerHub Description](https://github.com/peter-evans/dockerhub-description)
3+
You can update the [Docker Hub repository description](https://docs.docker.com/docker-hub/repos/)
4+
using a third party action called [Docker Hub Description](https://github.com/peter-evans/dockerhub-description)
55
with this action:
66

77
```yaml
@@ -26,7 +26,7 @@ jobs:
2626
name: Set up Docker Buildx
2727
uses: docker/setup-buildx-action@v2
2828
-
29-
name: Login to DockerHub
29+
name: Login to Docker Hub
3030
uses: docker/login-action@v2
3131
with:
3232
username: ${{ secrets.DOCKERHUB_USERNAME }}

docs/advanced/local-registry.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Local registry
22

3-
For testing purposes you may need to create a [local registry](https://hub.docker.com/_/registry) to push images into:
3+
For testing purposes you may need to create a [local registry](https://hub.docker.com/_/registry)
4+
to push images into:
45

56
```yaml
67
name: ci

docs/advanced/multi-platform.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Multi-platform image
22

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.
45

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
9+
> [setup-buildx](https://github.com/docker/setup-buildx-action#about) action.
10+
> * If you want support for more platforms, you can use QEMU with our
11+
> [setup-qemu](https://github.com/docker/setup-qemu-action) action.
812
913
```yaml
1014
name: ci
@@ -28,7 +32,7 @@ jobs:
2832
name: Set up Docker Buildx
2933
uses: docker/setup-buildx-action@v2
3034
-
31-
name: Login to DockerHub
35+
name: Login to Docker Hub
3236
uses: docker/login-action@v2
3337
with:
3438
username: ${{ secrets.DOCKERHUB_USERNAME }}

docs/advanced/named-contexts.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Dockerfile defines a stage with the same name it is overwritten.
77
This can be useful with GitHub Actions to reuse results from other builds or
88
pin an image to a spcific tag in your workflow.
99

10+
* [Pin image to a specific tag](#pin-image-to-a-specific-tag)
11+
* [Usage of the built image in other build steps](#usage-of-the-built-image-in-other-build-steps)
12+
1013
## Pin image to a specific tag
1114

1215
Replace `alpine:latest` with a pinned one:

docs/advanced/push-multi-registries.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# Push to multi-registries
22

3-
* [Docker Hub and GHCR](#docker-hub-and-ghcr)
4-
5-
## Docker Hub and GHCR
6-
7-
The following workflow will connect you to [DockerHub](https://github.com/docker/login-action#dockerhub)
8-
and [GitHub Container Registry](https://github.com/docker/login-action#github-container-registry) and push the
9-
image to these registries.
3+
The following workflow will connect you to [Docker Hub](https://github.com/docker/login-action#dockerhub)
4+
and [GitHub Container Registry](https://github.com/docker/login-action#github-container-registry)
5+
and push the image to these registries:
106

117
```yaml
128
name: ci
@@ -30,7 +26,7 @@ jobs:
3026
name: Set up Docker Buildx
3127
uses: docker/setup-buildx-action@v2
3228
-
33-
name: Login to DockerHub
29+
name: Login to Docker Hub
3430
uses: docker/login-action@v2
3531
with:
3632
username: ${{ secrets.DOCKERHUB_USERNAME }}

docs/advanced/secrets.md

+21-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
# Secrets
22

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)
44
as provided by GitHub in your workflow.
55

66
First let's create our `Dockerfile` to use our secret:
77

8-
```Dockerfile
9-
#syntax=docker/dockerfile:1.2
10-
8+
```dockerfile
9+
# syntax=docker/dockerfile:1
1110
FROM alpine
1211
RUN --mount=type=secret,id=github_token \
1312
cat /run/secrets/github_token
1413
```
1514

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):
1817

1918
```yaml
2019
name: ci
@@ -48,14 +47,17 @@ jobs:
4847
"github_token=${{ secrets.GITHUB_TOKEN }}"
4948
```
5049
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:
5253
> ```yaml
5354
> secret-files: |
5455
> "MY_SECRET=./secret.txt"
5556
> ```
5657

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
60+
between quotes:
5961

6062
```yaml
6163
secrets: |
@@ -72,13 +74,15 @@ secrets: |
7274
"JSON_SECRET={""key1"":""value1"",""key2"":""value2""}"
7375
```
7476

75-
| Key | Value |
76-
|--------------------|--------------------------------------------------|
77-
| `MYSECRET` | `***********************` |
78-
| `GIT_AUTH_TOKEN` | `abcdefghi,jklmno=0123456789` |
79-
| `MYSECRET` | `aaaaaaaa\nbbbbbbb\nccccccccc` |
80-
| `FOO` | `bar` |
81-
| `EMPTYLINE` | `aaaa\n\nbbbb\nccc` |
77+
| Key | Value |
78+
|--------------------|-------------------------------------|
79+
| `MYSECRET` | `***********************` |
80+
| `GIT_AUTH_TOKEN` | `abcdefghi,jklmno=0123456789` |
81+
| `MYSECRET` | `aaaaaaaa\nbbbbbbb\nccccccccc` |
82+
| `FOO` | `bar` |
83+
| `EMPTYLINE` | `aaaa\n\nbbbb\nccc` |
8284
| `JSON_SECRET` | `{"key1":"value1","key2":"value2"}` |
8385

84-
> :bulb: All quote signs need to be doubled for escaping.
86+
> **Note**
87+
>
88+
> All quote signs need to be doubled for escaping.

docs/advanced/share-image-jobs.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Share built image between jobs
22

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)
68
actions:
79

810
```yaml

docs/advanced/tags-labels.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Handle tags and labels
22

33
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:
67

78
```yaml
89
name: ci
@@ -51,7 +52,7 @@ jobs:
5152
name: Set up Docker Buildx
5253
uses: docker/setup-buildx-action@v2
5354
-
54-
name: Login to DockerHub
55+
name: Login to Docker Hub
5556
if: github.event_name != 'pull_request'
5657
uses: docker/login-action@v2
5758
with:

docs/advanced/test-before-push.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
name: Set up Docker Buildx
3434
uses: docker/setup-buildx-action@v2
3535
-
36-
name: Login to DockerHub
36+
name: Login to Docker Hub
3737
uses: docker/login-action@v2
3838
with:
3939
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -59,6 +59,8 @@ jobs:
5959
tags: ${{ env.TEST_TAG }}
6060
```
6161
62-
> :bulb: Build time will not be increased with this workflow because internal
63-
> cache for `linux/amd64` will be used from previous step on `Build and push`
64-
> step so only `linux/arm64` will be actually built.
62+
> **Note**
63+
>
64+
> Build time will not be increased with this workflow because internal cache
65+
> for `linux/amd64` will be used from previous step on `Build and push` step
66+
> so only `linux/arm64` will be actually built.

test/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
# syntax=docker/dockerfile:1
12
FROM alpine
2-
33
RUN echo "Hello world!"

test/addhost.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# syntax=docker/dockerfile:1
12
FROM busybox
23
RUN cat /etc/hosts

test/buildcontext.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# syntax=docker/dockerfile-upstream:master
1+
# syntax=docker/dockerfile:1
22
FROM alpine
33
RUN cat /etc/*release

test/cgroup.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# syntax=docker/dockerfile:1
12
FROM alpine
23
RUN cat /proc/self/cgroup

test/multi-sudo.Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
# syntax=docker/dockerfile:1
12
FROM --platform=$BUILDPLATFORM golang:alpine AS build
2-
33
ARG TARGETPLATFORM
44
ARG BUILDPLATFORM
55
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
6-
76
RUN apk --update --no-cache add \
87
shadow \
98
sudo \
@@ -17,6 +16,5 @@ RUN sudo chown buildx. /log
1716
USER root
1817

1918
FROM alpine
20-
2119
COPY --from=build /log /log
2220
RUN ls -al /log

test/multi.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1
12
FROM --platform=$BUILDPLATFORM golang:alpine AS build
23

34
ARG TARGETPLATFORM

test/nocachefilter.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1
12
FROM busybox AS base
23
RUN echo "Hello world!" > /hello
34

test/shmsize.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# syntax=docker/dockerfile:1
12
FROM busybox
23
RUN mount | grep /dev/shm

0 commit comments

Comments
 (0)