From 73008ad4ea9afc9b9dc00979a94f953cc3965497 Mon Sep 17 00:00:00 2001 From: Spolti Date: Tue, 27 Aug 2024 13:32:37 -0300 Subject: [PATCH] [RHOAIENG-11043] - Konflux Build failure for modelmesh-serving component chore: Add the go.mod and go.sum files to the builder image, on Konflux the dependencies were not getting resolved due to the lack of these files. Signed-off-by: Spolti --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6736e65..15225da0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,11 +39,13 @@ COPY controllers/ controllers/ COPY generated/ generated/ COPY pkg/ pkg/ COPY version /etc/modelmesh-version +# Copy the go.mod and sum and download dependencies +COPY go.mod go.mod +COPY go.sum go.sum +RUN go mod download # Build using native go compiler from BUILDPLATFORM but compiled output for TARGETPLATFORM -RUN --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg \ - GOOS=${TARGETOS:-linux} \ +RUN GOOS=${TARGETOS:-linux} \ GOARCH=${TARGETARCH:-amd64} \ CGO_ENABLED=0 \ GO111MODULE=on \