diff --git a/Dockerfile b/Dockerfile index eab061f5..f5564fa0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # Build the manager binary FROM golang:1.22.2-bullseye as builder +WORKDIR /workspace/api +COPY api/ . +RUN go mod download + WORKDIR /workspace # Copy the Go Modules manifests COPY go.mod go.mod @@ -11,7 +15,6 @@ RUN go mod download # Copy the go source COPY main.go main.go -COPY api/ api/ COPY pkg/ pkg/ COPY controllers/ controllers/ COPY utils/ utils/ diff --git a/redhat.Dockerfile b/redhat.Dockerfile index 1498f7c3..a010bd51 100644 --- a/redhat.Dockerfile +++ b/redhat.Dockerfile @@ -1,6 +1,10 @@ # Build the manager binary FROM golang:1.22.2-bullseye as builder +WORKDIR /workspace/api +COPY api/ . +RUN go mod download + WORKDIR /workspace # Copy the Go Modules manifests COPY go.mod go.mod @@ -11,7 +15,6 @@ RUN go mod download # Copy the go source COPY main.go main.go -COPY api/ api/ COPY pkg/ pkg/ COPY controllers/ controllers/ COPY utils/ utils/