checker-tls/Dockerfile
Pierre-Olivier Mercier ad32e1c757 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:37:18 +07:00

15 lines
359 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 -tags standalone -ldflags "-X main.Version=${CHECKER_VERSION}" -o /checker-tls .
FROM scratch
COPY --from=builder /checker-tls /checker-tls
USER 65534:65534
EXPOSE 8080
ENTRYPOINT ["/checker-tls"]