Env var to set provenance mode

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2024-02-03 15:08:18 +01:00
parent 94d76d3bc1
commit d8b90b1ab1
No known key found for this signature in database
GPG key ID: ADE44D8C9D44FBE4
3 changed files with 63 additions and 9 deletions

View file

@ -653,6 +653,46 @@ jobs:
run: |
cat /tmp/buildx-build/provenance.json | jq
provenance-env-mode:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mode:
- min
- max
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
driver-opts: |
network=host
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
-
name: Build
uses: ./
with:
context: ./test/go
file: ./test/go/Dockerfile
target: image
outputs: type=image,name=localhost:5000/name/app:latest,push=true
env:
BUILDX_PROVENANCE_MODE: ${{ matrix.mode }}
-
name: Inspect Provenance
run: |
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .Provenance}}'
sbom:
runs-on: ubuntu-latest
strategy: