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
|`docker-repository-name`| when pushing | — | Repository name excluding the hostname and tags. Public ECR includes a registry alias, e.g. `chainlink/chainlink`. Private ECR is just the repo name, e.g. `my-repo`. |
20
+
|`aws-account-number`| when pushing | — | AWS account number for the ECR registry. |
21
+
|`aws-role-arn`| when pushing | — | AWS role ARN with ECR push permissions. |
22
+
|`aws-region`| no |`us-east-1`| AWS region. Use `us-east-1` for public ECR. |
23
+
|`dockerfile`| no |`./Dockerfile`| Path to the Dockerfile. |
24
+
|`context`| no | — | Docker build context path or URL. Defaults to the Docker buildx default (repo root). |
25
+
|`docker-target`| no | — | Target stage in a multi-stage Dockerfile. |
26
+
|`docker-build-args`| no | — | Newline-delimited `KEY=VALUE` build arguments passed to `docker buildx build --build-arg`. See [Docker docs](https://docs.docker.com/reference/cli/docker/buildx/build/#build-arg). |
27
+
|`docker-build-contexts`| no | — | Additional named build contexts, e.g. `name=path`. |
28
+
|`docker-push`| no |`true`| Push the built image. Set to `false` for a build-only (no push) run. |
29
+
|`tags`| no |`type=sha,prefix=pr=,event=pr` / `type=ref,event=tag`| Tag spec consumed by [docker/metadata-action](https://github.com/docker/metadata-action). |
30
+
|`allow-overwrites`| no |`true`| When `false`, the action fails before building if any computed tag already exists in ECR. Useful for pseudo-immutability on public ECRs (which don't support native immutability) or as a fast-fail guard on private immutable ECRs. Ignored when `docker-push` is `false`. |
31
+
|`docker-restore-cache`| no |`false`| Restore the Docker layer cache before building. |
32
+
|`docker-save-cache`| no |`false`| Save the Docker layer cache after building. |
33
+
|`docker-build-cache-from`| no | GHA cache scoped to OS/arch | Override the cache source. Effective only when `docker-restore-cache` is `true`. |
34
+
|`docker-build-cache-to`| no | GHA cache scoped to OS/arch | Override the cache destination. Effective only when `docker-save-cache` is `true`. |
35
+
|`docker-attestations`| no |`true`| Generate SBOM and provenance attestations. See [Docker docs](https://docs.docker.com/build/ci/github-actions/attestations/). |
36
+
|`github-token`| no | — | GitHub token mounted as a Docker build secret (`GIT_AUTH_TOKEN`) for builds that fetch private dependencies. |
37
+
38
+
### Automatic `CL_AUTO_DOCKER_TAG` build arg
39
+
40
+
The action always injects a `CL_AUTO_DOCKER_TAG` build argument containing the
41
+
first computed tag (with any `-amd64`/`-arm64` suffix stripped). Dockerfiles can
42
+
consume it via `ARG CL_AUTO_DOCKER_TAG`. No configuration is needed; existing
Copy file name to clipboardExpand all lines: actions/build-push-docker/action.yml
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,16 @@ inputs:
113
113
114
114
Required when inputs.docker-push is true.
115
115
required: false
116
+
# other inputs
117
+
allow-overwrites:
118
+
description: |
119
+
Whether to allow overwriting existing image tags. If set to `false`, the action will fail if any of the tags already exist in ECR.
120
+
Ideally the ECR is immutable and tags cannot be overwritten. Public ECRs don't support immutability so this allows a psuedo-immutability by failing if a tag already exists.
121
+
This can be leveraged by immutable ECRs to fail-fast instead of building and subsequently failing to push.
122
+
123
+
Defaults to `true` for backwards compatibility. Ignored when inputs.docker-push is false.
0 commit comments