diff --git a/backend/Dockerfile b/backend/Dockerfile index fc8d1ca8467..77c2079ac34 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -35,11 +35,14 @@ RUN python3 -m pip install -r requirements.txt --no-cache-dir # Downloading Argo CLI so that the samples are validated ENV ARGO_VERSION v3.4.17 -RUN curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64.gz && \ - gunzip argo-linux-amd64.gz && \ - chmod +x argo-linux-amd64 && \ - mv ./argo-linux-amd64 /usr/local/bin/argo - +RUN ARCH=$(uname -m); \ +if [ "$ARCH" = "x86_64" ]; then \ + ARCH="amd64"; \ +fi \ +&& curl -sLO https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-${ARCH}.gz && \ +gunzip argo-linux-${ARCH}.gz && \ +chmod +x argo-linux-${ARCH} && \ +mv ./argo-linux-${ARCH} /usr/local/bin/argo WORKDIR / COPY ./samples /samples COPY backend/src/apiserver/config/sample_config.json /samples/ diff --git a/backend/Dockerfile.driver b/backend/Dockerfile.driver index 4f34cb42851..0b7dd7c6771 100644 --- a/backend/Dockerfile.driver +++ b/backend/Dockerfile.driver @@ -17,7 +17,11 @@ FROM golang:1.21.7-alpine3.19 as builder WORKDIR /go/src/github.com/kubeflow/pipelines 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 +RUN ARCH=$(uname -m) && \ + if [ "$ARCH" = "x86_64" ]; then \ + ARCH="amd64"; \ + fi && \ + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=$ARCH 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 diff --git a/backend/Dockerfile.launcher b/backend/Dockerfile.launcher index 30fc8b05789..171c3495450 100644 --- a/backend/Dockerfile.launcher +++ b/backend/Dockerfile.launcher @@ -17,7 +17,11 @@ FROM golang:1.21.7-alpine3.19 as builder WORKDIR /go/src/github.com/kubeflow/pipelines 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 +RUN ARCH=$(uname -m) && \ + if [ "$ARCH" = "x86_64" ]; then \ + ARCH="amd64"; \ + fi && \ + GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=$ARCH 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 diff --git a/backend/Makefile b/backend/Makefile index 741379e07e8..19e8dff4b9f 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -85,7 +85,7 @@ image_visualization: cd $(MOD_ROOT) && ${CONTAINER_ENGINE} build -t ${IMG_TAG_VISUALIZATION} -f backend/Dockerfile.visualization . .PHONY: image_driver image_driver: - cd $(MOD_ROOT) && ${CONTAINER_ENGINE} build -t ${IMG_TAG_DRIVER} -f backend/Dockerfile.driver . + cd $(MOD_ROOT) && ${CONTAINER_ENGINE} buildx build --platform $(PLATFORMS) ${IMG_TAG_DRIVER} -f backend/Dockerfile.driver --push . .PHONY: image_launcher image_launcher: - cd $(MOD_ROOT) && ${CONTAINER_ENGINE} build -t ${IMG_TAG_LAUNCHER} -f backend/Dockerfile.launcher . + cd $(MOD_ROOT) && ${CONTAINER_ENGINE} buildx build --platform $(PLATFORMS)${IMG_TAG_LAUNCHER} -f backend/Dockerfile.launcher --push .