diff --git a/Dockerfile b/Dockerfile index 4d4b649..0598a01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,12 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \ go build -ldflags="-w -s -X main.version=${VERSION}" -o /terdut ./cmd/terdut FROM scratch +# scratch has no trust store, and a Go binary on it fails every HTTPS call with +# "x509: certificate signed by unknown authority". Nothing needed one until single +# sign-on: discovery and the token exchange are HTTPS calls to the identity provider. +# The bundle is the builder's, copied by name so a missing file fails the build +# rather than shipping an image that cannot sign anybody in. +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /terdut /terdut EXPOSE 8080 ENTRYPOINT ["/terdut"]