Attempt to reduce memory requirements for docker build
Docker / build-and-push-image (push) Failing after 2m31s

This commit is contained in:
Jon Staab
2026-04-22 15:31:55 -07:00
parent 959d019b54
commit af4be86360
+10 -2
View File
@@ -1,7 +1,13 @@
FROM golang AS build
FROM --platform=$BUILDPLATFORM golang:1.25 AS build
ARG TARGETOS TARGETARCH
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu \
&& rm -rf /var/lib/apt/lists/*
COPY go.mod go.sum ./
RUN go mod download
@@ -9,7 +15,9 @@ RUN go mod download
COPY zooid zooid
COPY cmd cmd
RUN CGO_ENABLED=1 GOOS=linux go build -o bin/zooid cmd/relay/main.go
RUN CC=$(case "$TARGETARCH" in arm64) echo aarch64-linux-gnu-gcc ;; amd64) echo x86_64-linux-gnu-gcc ;; esac) \
CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -o bin/zooid cmd/relay/main.go
FROM gcr.io/distroless/base-debian12 AS run