File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
make/photon/trivy-adapter Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 22
33set +e
44
5- VERSION=" v0.33.2"
5+ VERSION=" 0.64.1"
6+ ADAPTER_VERSION=" v0.33.2"
67GOBUILDIMAGE=" golang:1.24.6"
78
89set -e
910
1011cd $( dirname $0 )
1112cur=$PWD
1213
14+ echo " Downloading static Trivy binary ..."
15+ STATIC_BINARY_URL=" https://github.com/aquasecurity/trivy/releases/download/v$VERSION /trivy_${VERSION} _Linux-64bit.tar.gz"
16+ mkdir -p binary
17+ curl -L $STATIC_BINARY_URL | tar -xz -C binary
1318# The temporary directory to clone Trivy adapter source code
1419TEMP=$( mktemp -d ${TMPDIR-/ tmp} /trivy-adapter.XXXXXX)
1520git clone https://github.com/goharbor/harbor-scanner-trivy.git $TEMP
16- cd $TEMP ; git checkout $VERSION ; cd -
21+ cd $TEMP ; git checkout $ADAPTER_VERSION ; cd -
1722
1823echo " Building Trivy adapter binary ..."
1924cp Dockerfile.binary $TEMP
2025docker buildx build --build-arg golang_image=$GOBUILDIMAGE -f $TEMP /Dockerfile.binary -t trivy-adapter-golang --load $TEMP
2126
2227echo " Copying Trivy adapter binary from the container to the local directory..."
2328ID=$( docker create trivy-adapter-golang)
24- docker cp $ID :/go/src/github.com/goharbor/harbor-scanner-trivy/scanner-trivy binary
29+ docker cp $ID :/go/src/github.com/goharbor/harbor-scanner-trivy/scanner-trivy binary/scanner-trivy
2530
2631docker rm -f $ID
2732docker rmi -f trivy-adapter-golang
You can’t perform that action at this time.
0 commit comments