diff --git a/backend/Dockerfile b/backend/Dockerfile index fc8d1ca8467..d5624ce8ab3 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -16,10 +16,17 @@ 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 ./ +COPY ./hack/install-go-licenses.sh ./hack/ + +RUN GO111MODULE=on go mod download +RUN ./hack/install-go-licenses.sh + COPY . . RUN GO111MODULE=on go build -o /bin/apiserver backend/src/apiserver/*.go # Check licenses and comply with license terms. -RUN ./hack/install-go-licenses.sh # First, make sure there's no forbidden license. RUN go-licenses check ./backend/src/apiserver RUN go-licenses csv ./backend/src/apiserver > /tmp/licenses.csv && \ diff --git a/backend/Dockerfile.cacheserver b/backend/Dockerfile.cacheserver index 1def8f51363..4e7d3508bd3 100644 --- a/backend/Dockerfile.cacheserver +++ b/backend/Dockerfile.cacheserver @@ -19,12 +19,19 @@ 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 ./ +COPY ./hack/install-go-licenses.sh ./hack/ + +RUN GO111MODULE=on go mod download +RUN ./hack/install-go-licenses.sh + COPY . . RUN GO111MODULE=on go build -o /bin/cache_server backend/src/cache/*.go # Check licenses and comply with license terms. -RUN ./hack/install-go-licenses.sh # First, make sure there's no forbidden license. RUN go-licenses check ./backend/src/cache RUN go-licenses csv ./backend/src/cache > /tmp/licenses.csv && \ diff --git a/backend/Dockerfile.conformance b/backend/Dockerfile.conformance index 60cad80b368..15c97b7277f 100644 --- a/backend/Dockerfile.conformance +++ b/backend/Dockerfile.conformance @@ -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 diff --git a/backend/Dockerfile.driver b/backend/Dockerfile.driver index 4f34cb42851..99008585712 100644 --- a/backend/Dockerfile.driver +++ b/backend/Dockerfile.driver @@ -15,12 +15,19 @@ FROM golang:1.21.7-alpine3.19 as builder WORKDIR /go/src/github.com/kubeflow/pipelines + +COPY ./go.mod ./ +COPY ./go.sum ./ +COPY ./hack/install-go-licenses.sh ./hack/ + +RUN GO111MODULE=on go mod download +RUN ./hack/install-go-licenses.sh + 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 # Check licenses and comply with license terms. -RUN ./hack/install-go-licenses.sh # First, make sure there's no forbidden license. RUN go-licenses check ./backend/src/v2/cmd/driver RUN go-licenses csv ./backend/src/v2/cmd/driver > /tmp/licenses.csv && \ diff --git a/backend/Dockerfile.launcher b/backend/Dockerfile.launcher index 30fc8b05789..2fc931156d0 100644 --- a/backend/Dockerfile.launcher +++ b/backend/Dockerfile.launcher @@ -15,12 +15,19 @@ FROM golang:1.21.7-alpine3.19 as builder WORKDIR /go/src/github.com/kubeflow/pipelines + +COPY ./go.mod ./ +COPY ./go.sum ./ +COPY ./hack/install-go-licenses.sh ./hack/ + +RUN GO111MODULE=on go mod download +RUN ./hack/install-go-licenses.sh + 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 # Check licenses and comply with license terms. -RUN ./hack/install-go-licenses.sh # First, make sure there's no forbidden license. RUN go-licenses check ./backend/src/v2/cmd/launcher-v2 RUN go-licenses csv ./backend/src/v2/cmd/launcher-v2 > /tmp/licenses.csv && \ diff --git a/backend/Dockerfile.persistenceagent b/backend/Dockerfile.persistenceagent index 04206168735..93a38618d3d 100644 --- a/backend/Dockerfile.persistenceagent +++ b/backend/Dockerfile.persistenceagent @@ -15,6 +15,14 @@ FROM golang:1.21.7-alpine3.19 as builder WORKDIR /go/src/github.com/kubeflow/pipelines + +COPY ./go.mod ./ +COPY ./go.sum ./ +COPY ./hack/install-go-licenses.sh ./hack/ + +RUN GO111MODULE=on go mod download +RUN ./hack/install-go-licenses.sh + COPY . . # Needed musl-dev for github.com/mattn/go-sqlite3 @@ -23,7 +31,6 @@ RUN apk update && apk upgrade && \ RUN GO111MODULE=on go build -o /bin/persistence_agent backend/src/agent/persistence/*.go # Check licenses and comply with license terms. -RUN ./hack/install-go-licenses.sh # First, make sure there's no forbidden license. RUN go-licenses check ./backend/src/agent/persistence RUN go-licenses csv ./backend/src/agent/persistence > /tmp/licenses.csv && \ diff --git a/backend/Dockerfile.scheduledworkflow b/backend/Dockerfile.scheduledworkflow index 2fb190bf647..021f15b4691 100644 --- a/backend/Dockerfile.scheduledworkflow +++ b/backend/Dockerfile.scheduledworkflow @@ -15,6 +15,14 @@ FROM golang:1.21.7-alpine3.19 as builder WORKDIR /go/src/github.com/kubeflow/pipelines + +COPY ./go.mod ./ +COPY ./go.sum ./ +COPY ./hack/install-go-licenses.sh ./hack/ + +RUN GO111MODULE=on go mod download +RUN ./hack/install-go-licenses.sh + COPY . . # Needed musl-dev for github.com/mattn/go-sqlite3 @@ -23,7 +31,6 @@ RUN apk update && apk upgrade && \ RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go # Check licenses and comply with license terms. -RUN ./hack/install-go-licenses.sh # First, make sure there's no forbidden license. RUN go-licenses check ./backend/src/crd/controller/scheduledworkflow RUN go-licenses csv ./backend/src/crd/controller/scheduledworkflow > /tmp/licenses.csv && \ diff --git a/backend/Dockerfile.viewercontroller b/backend/Dockerfile.viewercontroller index 32278729f13..73f4fbdb1db 100644 --- a/backend/Dockerfile.viewercontroller +++ b/backend/Dockerfile.viewercontroller @@ -18,11 +18,18 @@ 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 ./ +COPY ./hack/install-go-licenses.sh ./hack/ + +RUN GO111MODULE=on go mod download +RUN ./hack/install-go-licenses.sh + COPY . . RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/viewer/*.go # Check licenses and comply with license terms. -RUN ./hack/install-go-licenses.sh # First, make sure there's no forbidden license. RUN go-licenses check ./backend/src/crd/controller/viewer RUN go-licenses csv ./backend/src/crd/controller/viewer > /tmp/licenses.csv && \