-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 770 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 770 Bytes
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
FROM golang:1.26-alpine AS builder
WORKDIR /build
ARG COMMIT_SHA=dev
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath \
-ldflags="-w -s -X main.commitHash=$(echo ${COMMIT_SHA} | cut -c1-7)" \
-o lancert ./cmd/lancert/
RUN CGO_ENABLED=0 go build -trimpath \
-ldflags="-w -s" \
-o healthcheck ./cmd/healthcheck/
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=builder /build/lancert /usr/local/bin/lancert
COPY --from=builder /build/healthcheck /usr/local/bin/healthcheck
VOLUME /data
EXPOSE 53/udp 53/tcp 8443
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
CMD ["/usr/local/bin/healthcheck"]
ENTRYPOINT ["lancert"]
CMD ["-data-dir", "/data", "-http-addr", ":8443"]