diff --git a/actions/docker-build-push-image/README.md b/actions/docker-build-push-image/README.md index a1d6f3ff0..4b3bc9c8c 100644 --- a/actions/docker-build-push-image/README.md +++ b/actions/docker-build-push-image/README.md @@ -52,6 +52,7 @@ jobs: | Name | Type | Description | | ----------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `annotations` | String | List of custom annotations to add to the image as metadata. Passed to `docker/build-push-action`. | | `build-args` | String | List of arguments necessary for the Docker image to be built. Passed to `docker/build-push-action`. | | `build-contexts` | String | List of additional build contexts (e.g., name=path). Passed to `docker/build-push-action`. | | `buildkitd-config` | String | The buildkitd config file to use. Defaults to `/etc/buildkitd.toml` if you're using Grafana's self-hosted runners. Passed to `docker/setup-buildx-action`. | diff --git a/actions/docker-build-push-image/action.yaml b/actions/docker-build-push-image/action.yaml index e61e3bf29..7e96d32c7 100644 --- a/actions/docker-build-push-image/action.yaml +++ b/actions/docker-build-push-image/action.yaml @@ -2,6 +2,10 @@ name: Build and Push Docker Image description: Composite action to push a docker image to GAR or DockerHub inputs: + annotations: + description: | + List of custom annotations to add to the image as metadata (passed to `docker/build-push-action`). + Passed to `docker/build-push-action`. build-args: description: | List of arguments necessary for the Docker image to be built. @@ -264,6 +268,7 @@ runs: id: meta uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 with: + annotations: ${{ inputs.annotations }} images: ${{ steps.setup-vars.outputs.images }} labels: ${{ inputs.labels }} tags: ${{ inputs.tags }} @@ -326,6 +331,7 @@ runs: uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 id: build with: + annotations: ${{ steps.meta.outputs.annotations }} build-args: ${{ inputs.build-args }} build-contexts: ${{ inputs.build-contexts }} cache-from: ${{ inputs.cache-from }}