Skip to content

Commit

Permalink
Added cached layer for Go dependencies to Dockerfiles
Browse files Browse the repository at this point in the history
Signed-off-by: Helber Belmiro <[email protected]>
  • Loading branch information
hbelmiro committed Oct 31, 2024
1 parent c5b787a commit 4f6e9c7
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
FROM golang:1.21.7-bookworm as builder
RUN apt-get update && apt-get install -y cmake clang musl-dev openssl
WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .
RUN GO111MODULE=on go build -o /bin/apiserver backend/src/apiserver/*.go
# Check licenses and comply with license terms.
Expand Down
6 changes: 6 additions & 0 deletions backend/Dockerfile.cacheserver
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev

WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .

RUN GO111MODULE=on go build -o /bin/cache_server backend/src/cache/*.go
Expand Down
6 changes: 6 additions & 0 deletions backend/Dockerfile.conformance
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev

WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .

# Compile the test
Expand Down
6 changes: 6 additions & 0 deletions backend/Dockerfile.driver
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
FROM golang:1.21.7-alpine3.19 as builder

WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .

RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/driver ./backend/src/v2/cmd/driver/*.go
Expand Down
6 changes: 6 additions & 0 deletions backend/Dockerfile.launcher
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
FROM golang:1.21.7-alpine3.19 as builder

WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .

RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/launcher-v2 ./backend/src/v2/cmd/launcher-v2/*.go
Expand Down
6 changes: 6 additions & 0 deletions backend/Dockerfile.persistenceagent
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
FROM golang:1.21.7-alpine3.19 as builder

WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .

# Needed musl-dev for github.com/mattn/go-sqlite3
Expand Down
6 changes: 6 additions & 0 deletions backend/Dockerfile.scheduledworkflow
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
FROM golang:1.21.7-alpine3.19 as builder

WORKDIR /go/src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .

# Needed musl-dev for github.com/mattn/go-sqlite3
Expand Down
6 changes: 6 additions & 0 deletions backend/Dockerfile.viewercontroller
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ RUN apk update && apk upgrade
RUN apk add --no-cache git gcc musl-dev

WORKDIR /src/github.com/kubeflow/pipelines

COPY ./go.mod ./
COPY ./go.sum ./

RUN GO111MODULE=on go mod download

COPY . .

RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/viewer/*.go
Expand Down

0 comments on commit 4f6e9c7

Please sign in to comment.