Skip to content

Commit 2dd0b03

Browse files
docs: improve docker build action docs (#1486)
* Update build-push-to-dockerhub and push-to-gar-docker input definitions, and alphabetized them * add defaults to docker build workflows * Expand on description of docker caching * Fix incorrect desc line break
1 parent 5236a06 commit 2dd0b03

File tree

5 files changed

+109
-82
lines changed

5 files changed

+109
-82
lines changed

actions/build-push-to-dockerhub/README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,22 @@ jobs:
4646
4747
## Inputs
4848
49-
| Name | Type | Description |
50-
| ---------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
51-
| `context` | String | Path to the Dockerfile (default: `.`) |
52-
| `platforms` | List | List of platforms the image should be built for (e.g. `linux/amd64,linux/arm64`) |
53-
| `push` | Bool | Push the generated image (default: `false`) |
54-
| `repository` | String | Docker repository name (**required**) |
55-
| `tags` | List | Tags that should be used for the image (see the [metadata-action][mda] for details) |
56-
| `labels` | List | Labels that should be used for the image (see the [metadata-action][mda] for details) |
57-
| `file` | String | Path and filename of the dockerfile to build from. (Default: `{context}/Dockerfile`) |
58-
| `build-args` | String | List of arguments necessary for the Docker image to be built. |
59-
| `target` | String | Sets the target stage to build |
60-
| `cache-from` | String | Where cache should be fetched from ([more about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)) |
61-
| `cache-to` | String | Where cache should be stored to ([more about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)) |
62-
| `docker-buildx-driver` | String | The [driver](https://github.com/docker/setup-buildx-action/tree/v3/?tab=readme-ov-file#customizing) to use for Docker Buildx |
63-
| `secrets` | List | Secrets to [expose to the build](https://github.com/docker/build-push-action). Only needed when authenticating to private repositories outside the repository in which the image is being built. |
49+
| Name | Type | Description | Default |
50+
| ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
51+
| `build-args` | String | List of arguments necessary for the Docker image to be built. | |
52+
| `cache-from` | String | Where cache should be fetched from ([more about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)) | type=gha |
53+
| `cache-to` | String | Where cache should be stored to ([more about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)) | type=gha,mode=max |
54+
| `context` | String | Path to the Docker build context. | . |
55+
| `docker-buildx-driver` | String | The [driver](https://github.com/docker/setup-buildx-action/tree/v3/?tab=readme-ov-file#customizing) to use for Docker Buildx | docker-container |
56+
| `file` | String | Path and filename of the dockerfile to build from. (Default: `{context}/Dockerfile`) | |
57+
| `labels` | List | Labels that should be used for the image (see the [metadata-action][mda] for details) | |
58+
| `load` | Boolean | Whether to load the built image into the local docker daemon. | false |
59+
| `platforms` | String | List of platforms the image should be built for (e.g. `linux/amd64,linux/arm64`) | |
60+
| `push` | Boolean | Push the generated image | false |
61+
| `repository` | String | Docker repository name (**required**) | |
62+
| `secrets` | String | Secrets to [expose to the build](https://github.com/docker/build-push-action). Only needed when authenticating to private repositories outside the repository in which the image is being built. | |
63+
| `tags` | String | Tags that should be used for the image (see the [metadata-action][mda] for details) | |
64+
| `target` | String | Sets the target stage to build | |
6465

6566
[mda]: https://github.com/docker/metadata-action?tab=readme-ov-file#tags-input
6667

actions/build-push-to-dockerhub/action.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ description: Build and publish docker images to DockerHub
44
inputs:
55
repository:
66
description: |
7-
The caller workflow's repository
7+
Docker repository name (**required**)
88
tags:
99
description: |
10-
List of Docker images to be pushed.
10+
Tags that should be used for the image (see the [metadata-action][mda] for details)
1111
required: true
1212
labels:
1313
description: |
@@ -19,15 +19,15 @@ inputs:
1919
default: "."
2020
platforms:
2121
description: |
22-
List of platforms to build the image for
22+
List of platforms the image should be built for (e.g. `linux/amd64,linux/arm64`)
2323
required: false
2424
push:
2525
description: |
26-
Also push the generated images to DockerHub
26+
Push the generated image
2727
default: "false"
2828
file:
2929
description: |
30-
The dockerfile to use.
30+
Path and filename of the dockerfile to build from. (Default: `{context}/Dockerfile`)
3131
required: false
3232
build-args:
3333
description: |
@@ -36,26 +36,30 @@ inputs:
3636
default: ""
3737
target:
3838
description: |
39-
Target stage to build
39+
Sets the target stage to build
4040
required: false
4141
cache-from:
4242
description: |
43-
Where cache should be fetched from
44-
required: false
43+
Where cache should be fetched from.
44+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
45+
46+
[More about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)
4547
default: "type=gha"
4648
cache-to:
4749
description: |
48-
Where cache should be stored to
49-
required: false
50+
Where cache should be stored to.
51+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
52+
53+
[More about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)
5054
default: "type=gha,mode=max"
5155
docker-buildx-driver:
5256
description: |
53-
The driver to use for Docker Buildx
57+
The [driver](https://github.com/docker/setup-buildx-action/tree/v3/?tab=readme-ov-file#customizing) to use for Docker Buildx
5458
required: false
5559
default: "docker-container"
5660
secrets:
5761
description: |
58-
Secrets to expose to the build. Only needed when authenticating to private repositories outside the repository in which the image is being built.
62+
Secrets to [expose to the build](https://github.com/docker/build-push-action). Only needed when authenticating to private repositories outside the repository in which the image is being built.
5963
required: false
6064
load:
6165
description: |

actions/docker-build-push-image/action.yaml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,43 @@ inputs:
99
build-args:
1010
description: |
1111
List of arguments necessary for the Docker image to be built.
12-
Passed to `docker/build-push-action`.
12+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
1313
build-contexts:
1414
description: |
1515
List of additional build contexts (e.g., name=path).
16-
Passed to `docker/build-push-action`.
16+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
1717
buildkitd-config:
1818
description: |
1919
The buildkitd config file to use. Defaults to `/etc/buildkitd.toml` if you're using
2020
Grafana's self-hosted runners.
21-
Passed to `docker/setup-buildx-action`.
21+
Passed to [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action?tab=readme-ov-file#inputs).
2222
buildkitd-config-inline:
2323
description: |
2424
The buildkitd inline config to use.
25-
Passed to `docker/setup-buildx-action`.
25+
Passed to [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action?tab=readme-ov-file#inputs).
2626
cache-from:
2727
description: |
2828
Where cache should be fetched from.
29-
Passed to `docker/build-push-action`.
29+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
30+
31+
[More about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)
3032
default: type=gha
3133
cache-to:
3234
description: |
3335
Where cache should be stored to.
34-
Passed to `docker/build-push-action`.
36+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
37+
38+
[More about GHA and container caching](https://www.kenmuse.com/blog/implementing-docker-layer-caching-in-github-actions/)
3539
default: type=gha,mode=max
3640
context:
3741
description: |
3842
Path to the Docker build context.
39-
Passed to `docker/build-push-action`.
43+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
4044
default: .
4145
docker-buildx-driver:
4246
description: |
4347
The driver to use for Docker Buildx.
44-
Passed to `docker/setup-buildx-action`.
48+
Passed to [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action?tab=readme-ov-file#inputs).
4549
default: docker-container
4650
dockerhub-registry:
4751
description: |
@@ -55,7 +59,7 @@ inputs:
5559
file:
5660
description: |
5761
The dockerfile to use.
58-
Passed to `docker/build-push-action`.
62+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
5963
gar-delete-credentials-file:
6064
description: |
6165
Delete the Google credentials file after the action is finished.
@@ -86,46 +90,46 @@ inputs:
8690
default: "true"
8791
labels:
8892
description: |
89-
List of custom labels to add to the image as metadata (passed to `docker/build-push-action`).
90-
Passed to `docker/build-push-action`.
93+
List of custom labels to add to the image as metadata (Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs)).
94+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
9195
load:
9296
description: |
93-
Whether to load the built image into the local docker daemon (passed to `docker/build-push-action`).
94-
Passed to `docker/build-push-action`.
97+
Whether to load the built image into the local docker daemon (Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs)).
98+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
9599
default: "false"
96100
outputs:
97101
description: |
98102
List of docker output destinations.
99-
Passed to `docker/build-push-action`.
103+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
100104
platforms:
101105
description: |
102106
List of platforms to build the image for.
103-
Passed to `docker/build-push-action`.
107+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
104108
push:
105109
description: |
106110
Whether to push the image to the configured registries.
107-
Passed to `docker/build-push-action`.
111+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
108112
registries:
109113
description: |
110114
CSV list of registries to build images for.
111115
Accepted registries are "gar" and "dockerhub".
112116
secrets:
113117
description: |
114118
Secrets to expose to the build. Only needed when authenticating to private repositories outside the repository in which the image is being built.
115-
Passed to `docker/build-push-action`.
119+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
116120
ssh:
117121
description: |
118122
List of SSH agent socket or keys to expose to the build
119-
Passed to `docker/build-push-action`.
123+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
120124
tags:
121125
description: |
122126
List of Docker tags to be pushed.
123-
Passed to `docker/build-push-action`.
127+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
124128
required: true
125129
target:
126130
description: |
127131
Sets the target stage to build.
128-
Passed to `docker/build-push-action`.
132+
Passed to [docker/build-push-action](https://github.com/docker/build-push-action?tab=readme-ov-file#inputs).
129133
130134
outputs:
131135
annotations:

0 commit comments

Comments
 (0)