trying to fix dockerfile
This commit is contained in:
@@ -31,9 +31,6 @@ jobs:
|
|||||||
-u "${{ env.REGISTRY_USERNAME }}" \
|
-u "${{ env.REGISTRY_USERNAME }}" \
|
||||||
--password-stdin
|
--password-stdin
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,18 @@ FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS builder
|
|||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETOS
|
ARG TARGETOS
|
||||||
|
|
||||||
|
# Install CA certificates in the builder (runs natively, no QEMU needed)
|
||||||
|
RUN apk --no-cache add ca-certificates
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
# Build statically for Linux
|
# Build statically for Linux
|
||||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o mindforge-cronjob main.go
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o mindforge-cronjob main.go
|
||||||
|
|
||||||
# Use Alpine for running, with CA certificates for TLS
|
# Use scratch to avoid QEMU: no foreign-arch commands to emulate
|
||||||
FROM alpine:latest
|
FROM scratch
|
||||||
WORKDIR /app
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
RUN apk --no-cache add ca-certificates
|
COPY --from=builder /app/mindforge-cronjob /app/mindforge-cronjob
|
||||||
COPY --from=builder /app/mindforge-cronjob .
|
|
||||||
ENV GIT_REPOSITORY=""
|
ENV GIT_REPOSITORY=""
|
||||||
ENV GEMINI_API_KEY=""
|
ENV GEMINI_API_KEY=""
|
||||||
ENV OPENAI_API_KEY=""
|
ENV OPENAI_API_KEY=""
|
||||||
|
|||||||
Reference in New Issue
Block a user