forked from zapier/preoomkiller-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (19 loc) · 822 Bytes
/
Dockerfile
File metadata and controls
25 lines (19 loc) · 822 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
# https://hub.docker.com/_/golang/tags?name=1.25.6-alpine3.23
FROM golang:1.25.6-alpine3.23 AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY ./cmd/ ./cmd/
COPY ./internal/ ./internal/
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o ./preoomkiller-controller ./cmd/preoomkiller-controller
# Stage with tzdata for zoneinfo (version explicit for reproducible builds)
FROM alpine:3.23.3 AS tzdata
# https://pkgs.alpinelinux.org/packages?name=tzdata&branch=v3.23&repo=&arch=x86_64
RUN apk --no-cache add \
tzdata=2025c-r0
# Final image: scratch + binary + zoneinfo
FROM scratch
ENV ZONEINFO=/usr/share/zoneinfo
COPY --from=tzdata /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /build/preoomkiller-controller /bin/preoomkiller-controller
ENTRYPOINT ["/bin/preoomkiller-controller"]