File tree Expand file tree Collapse file tree
kargo/custom-steps/trivy-image Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Release Trivy
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag :
7+ description : " Image tag (e.g. 1.2.3)"
8+ required : true
9+ type : string
10+
11+ jobs :
12+ build-and-push :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+ packages : write
17+ steps :
18+ - uses : actions/checkout@v6
19+
20+ - name : Set up QEMU
21+ uses : docker/setup-qemu-action@v4
22+
23+ - name : Set up Docker Buildx
24+ uses : docker/setup-buildx-action@v4
25+
26+ - name : Log in to GitHub Container Registry
27+ uses : docker/login-action@v4
28+ with :
29+ registry : ghcr.io
30+ username : ${{ github.actor }}
31+ password : ${{ secrets.GITHUB_TOKEN }}
32+
33+ - name : Build and push
34+ uses : docker/build-push-action@v7
35+ with :
36+ context : docker/trivy
37+ platforms : linux/amd64,linux/arm64
38+ push : true
39+ build-args : |
40+ TRIVY_VERSION=${{ inputs.tag }}
41+ tags : ghcr.io/${{ github.repository_owner }}/trivy:${{ inputs.tag }}
Original file line number Diff line number Diff line change 1+ ARG TRIVY_VERSION=latest
2+ FROM aquasec/trivy:${TRIVY_VERSION}
3+
4+ # Download the vulnerability DB at build time
5+ RUN trivy image --download-db-only
Original file line number Diff line number Diff line change 1+ # Trivy Image
2+
3+ This is a trivy image with the database pre-downloaded, in order to avoid downloading the
4+ database every time a custom executes.
Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ kind: CustomPromotionStep
33metadata :
44 name : trivy-image
55spec :
6- image : aquasec /trivy:0.69.3
6+ image : ghcr.io/jessesuen /trivy:0.69.3
77 command :
88 - trivy
99 - image
1010 - --exit-code=1
1111 - --severity=CRITICAL
1212 - --disable-telemetry
13+ - --skip-db-update
1314 - --scanners=vuln
1415 - ${{ config.image }}
You can’t perform that action at this time.
0 commit comments