diff --git a/Dockerfile b/Dockerfile index 9abd1b0098a..6425e3e3253 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /go/src/github.com/kserve/kserve COPY go.mod go.mod COPY go.sum go.sum -RUN go mod download +RUN go mod download COPY cmd/ cmd/ COPY pkg/ pkg/ diff --git a/agent.Dockerfile b/agent.Dockerfile index 07d0260eec6..70a529bd5a2 100644 --- a/agent.Dockerfile +++ b/agent.Dockerfile @@ -5,10 +5,11 @@ FROM golang:1.21 as builder WORKDIR /go/src/github.com/kserve/kserve COPY go.mod go.mod COPY go.sum go.sum + RUN go mod download -COPY pkg/ pkg/ COPY cmd/ cmd/ +COPY pkg/ pkg/ # Build RUN CGO_ENABLED=0 GOOS=linux go build -a -o agent ./cmd/agent diff --git a/router.Dockerfile b/router.Dockerfile index 1b3e2413840..c9a416d5124 100644 --- a/router.Dockerfile +++ b/router.Dockerfile @@ -8,8 +8,8 @@ COPY go.sum go.sum RUN go mod download -COPY pkg/ pkg/ COPY cmd/ cmd/ +COPY pkg/ pkg/ # Build RUN CGO_ENABLED=0 go build -a -o router ./cmd/router