checker-zonemaster/Dockerfile
Pierre-Olivier Mercier bf409ba33c Run container as non-root user
Add USER 65534:65534 to the scratch runtime image so the checker
process does not run as root.
2026-04-26 16:41:06 +07:00

15 lines
370 B
Docker

FROM golang:1.25-alpine AS builder
ARG CHECKER_VERSION=custom-build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -ldflags "-X main.Version=${CHECKER_VERSION}" -o /checker-zonemaster .
FROM scratch
COPY --from=builder /checker-zonemaster /checker-zonemaster
USER 65534:65534
EXPOSE 8080
ENTRYPOINT ["/checker-zonemaster"]