From ab93c0269a393f439b1e720d71e5fe0d25c2faad Mon Sep 17 00:00:00 2001 From: Lucas <116588+hairmare@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:05:02 +0100 Subject: [PATCH] feat(release-container): Add optional build-args input (#101) --- .github/workflows/release-container.yaml | 7 +++++++ README.md | 3 +++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/release-container.yaml b/.github/workflows/release-container.yaml index 9f1c3c5..fd8f28c 100644 --- a/.github/workflows/release-container.yaml +++ b/.github/workflows/release-container.yaml @@ -49,6 +49,11 @@ on: required: false default: '.' type: string + build-args: + description: 'Pass ARGs to the build' + required: false + default: '' + type: string jobs: docker: @@ -127,6 +132,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max + build-args: ${{ inputs.build-args }} labels: | ${{ steps.meta.outputs.labels }} version=${{ steps.meta.outputs.version }} @@ -181,6 +187,7 @@ jobs: push: ${{ github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags/v') }} tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha + build-args: ${{ inputs.build-args }} labels: | ${{ steps.meta.outputs.labels }} version=${{ steps.meta.outputs.version }} diff --git a/README.md b/README.md index 6db8275..74d6ee5 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ jobs: cosign-base-image-only: [true] # (8) dockerfile: [Dockerfile] # (9) context: [.] # (10) + build-args: "" # (11) ``` 1. Replace this with the actual name of the image, usually something like the @@ -117,6 +118,8 @@ jobs: source image that isn't signed with cosign. 9. Specify the path to the Dockerfile if it isn't in the root of the repository. 10. Specify the context directory for Docker build. +11. Build ARGs for the conatimer image build, formatted as `KEY=value` and + separated by newlines if more than one arg is needed. As a last step, it is recommended to add `trivy.*` to both your `.gitignore` and `.dockerignore` files so trivy can't interfere with multi-stage builds.