fix: limit GOMAXPROCS in build to prevent OOM during parallel bake
This commit is contained in:
+2
-2
@@ -26,7 +26,7 @@ RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
||||
COPY . .
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
go build -ldflags="-s -w" -o /app/main ./{service_dir}
|
||||
GOMAXPROCS=2 go build -ldflags="-s -w" -o /app/main ./{service_dir}
|
||||
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
@@ -48,7 +48,7 @@ RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
||||
COPY . .
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
go build -ldflags="-s -w" -o /app/main ./{service_dir}
|
||||
GOMAXPROCS=2 go build -ldflags="-s -w" -o /app/main ./{service_dir}
|
||||
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
Reference in New Issue
Block a user