# Start from the official Golang image for building FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS builder ARG TARGETARCH ARG TARGETOS # Install CA certificates in the builder (runs natively, no QEMU needed) RUN apk --no-cache add ca-certificates WORKDIR /app COPY . . # Build statically for Linux RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o mindforge-cronjob main.go # Use scratch to avoid QEMU: no foreign-arch commands to emulate FROM scratch COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /app/mindforge-cronjob /app/mindforge-cronjob ENV GIT_REPOSITORY="" ENV GEMINI_API_KEY="" ENV OPENAI_API_KEY="" ENV DISCORD_WEBHOOK_URL="" ENV HAVEN_NOTIFY_URL="" ENV SSH_PRIVATE_KEY="" ENTRYPOINT ["/app/mindforge-cronjob"]