-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (23 loc) · 1.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Build the manager binary
FROM golang:1.22.3-alpine3.18 as builder
COPY . /go/src/github.com/uselagoon/lagoon/services/insights-handler/
WORKDIR /go/src/github.com/uselagoon/lagoon/services/insights-handler/
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY main.go main.go
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o insights-handler main.go
# we pull the trivy binary from aquasec's alpine based image
FROM aquasec/trivy:0.54.1 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.20
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 .
COPY default_filter_transformers.yaml /default_filter_transformers.yaml
USER 65532:65532
ENTRYPOINT ["/insights-handler"]