Building on arm64 Mac without GOOS/GOARCH produced amd64 node "exec format error". The homelab CA was only trusted in the build stage, so the final distroless runtime couldn't verify Authentik's TLS cert during OIDC discovery.
15 lines
492 B
Docker
15 lines
492 B
Docker
FROM golang:1.26 AS build
|
|
WORKDIR /src
|
|
ENV GOPRIVATE=forgejo.riotpiao.homelab.com
|
|
COPY hack/homelab-ca.pem /usr/local/share/ca-certificates/homelab-ca.crt
|
|
RUN update-ca-certificates
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -o /out/queue-operator ./cmd/queue-operator
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/queue-operator /queue-operator
|
|
USER nonroot:nonroot
|
|
ENTRYPOINT ["/queue-operator"]
|