-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
35 lines (26 loc) · 901 Bytes
/
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
35
FROM golang:1.23-bullseye as builder
RUN apt-get update \
&& apt-get install --yes entr \
&& rm -rf /var/lib/apt/lists/*
COPY LICENSE /
COPY NOTICE /
WORKDIR /app
# Copy the Go Modules manifests
COPY go.* ./
COPY pkg/ ./pkg/
# 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 . .
# Cache intermediate build artifacts
# RUN go build ./...
RUN make build
# Use distroless as minimal base image to package the axo-controller binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/base-debian11:latest as prod
WORKDIR /
COPY --from=builder /LICENSE /
COPY --from=builder /NOTICE /
COPY --from=builder /app/dist/axosyslog-metrics-exporter .
ENTRYPOINT ["/axosyslog-metrics-exporter"]