From e34cca218de137d70b05e7064fb12597009a2830 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Mon, 10 Jul 2023 09:10:05 -0700 Subject: [PATCH] trying to fix OOM parallel build issue --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd98d7b2..0193c55c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,12 +26,13 @@ FROM golang:1.18 as backend-build WORKDIR /go/src/github.com/fastenhealth/fastenhealth-onprem COPY . . -RUN go mod vendor \ +RUN --mount=type=cache,target=/tmp/lock,sharing=locked \ + go mod vendor \ && go install github.com/golang/mock/mockgen@v1.6.0 \ && go generate ./... \ && go vet ./... \ - && go test ./... -RUN CGO_ENABLED=0 go build -o /go/bin/fasten ./backend/cmd/fasten/ + && go test ./... \ + && CGO_ENABLED=0 go build -o /go/bin/fasten ./backend/cmd/fasten/ # create folder structure RUN mkdir -p /opt/fasten/db \