2024-06-24 11:15:21 +02:00
|
|
|
FROM golang:1.22 as builder
|
2021-12-08 09:25:34 +01:00
|
|
|
WORKDIR /go/src/app
|
2023-08-08 10:30:24 +02:00
|
|
|
|
|
|
|
ENV PATH=$PATH:/go/src/app/.bin
|
|
|
|
|
2021-12-08 09:25:34 +01:00
|
|
|
COPY . .
|
|
|
|
RUN make test &&\
|
|
|
|
make manager
|
|
|
|
|
|
|
|
# Use distroless as minimal base image to package the manager binary
|
|
|
|
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
2023-08-08 10:30:24 +02:00
|
|
|
FROM gcr.io/distroless/static:nonroot
|
|
|
|
WORKDIR /
|
2021-12-08 09:25:34 +01:00
|
|
|
COPY --from=builder /go/src/app/manager .
|
2023-08-08 10:30:24 +02:00
|
|
|
USER 65532:65532
|
|
|
|
|
2021-12-08 09:25:34 +01:00
|
|
|
ENTRYPOINT ["/manager"]
|