Skip to content

Commit

Permalink
feat(release-container): Add optional build-args input (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Nov 19, 2024
1 parent d37d42f commit ab93c02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit ab93c02

Please sign in to comment.