Skip to content

Commit

Permalink
Reorder Go docker files for better layer caching
Browse files Browse the repository at this point in the history
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
  • Loading branch information
sivanantha321 committed Feb 16, 2024
1 parent a988430 commit a942bad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
3 changes: 2 additions & 1 deletion agent.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion router.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a942bad

Please sign in to comment.