From 6e62d8f61f82686eed2713be726303f229daae3f Mon Sep 17 00:00:00 2001 From: Blaize M Kaye Date: Wed, 6 Dec 2023 11:10:21 +1300 Subject: [PATCH] Adds trivy binary --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5128352..afb8239 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,17 @@ COPY main.go main.go # Build RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o insights-handler main.go +# we pull the trivy binary from aquasec's alpine based image +FROM aquasec/trivy:0.48.0 as trivy + # Use distroless as minimal base image to package the insights-handler binary # Refer to https://github.com/GoogleContainerTools/distroless for more details #FROM gcr.io/distroless/static:nonroot FROM alpine:3.18 +COPY --from=trivy /usr/local/bin/trivy /usr/local/bin/trivy + WORKDIR / COPY --from=builder /go/src/github.com/uselagoon/lagoon/services/insights-handler/insights-handler .