Add USER 65534:65534 to the scratch runtime image so the checker process does not run as root.
15 lines
359 B
Docker
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"]
|