From 0779707734c07e7c2a6933bed21bf44d86cccd2a Mon Sep 17 00:00:00 2001 From: hsinhoyeh Date: Mon, 3 Aug 2026 14:06:16 +0800 Subject: [PATCH] Download the Bazel release matching the build architecture The server image hardcoded bazel-$BAZEL_VERSION-installer-linux-x86_64.sh, so ml_metadata_store_server could only be built on x86_64. This is one of the reasons the published image is amd64-only, which in turn blocks Kubeflow Pipelines on ARM clusters (kubeflow/pipelines#10308). Bazel publishes a linux-arm64 release for 7.7.0, but as a plain binary rather than an installer script, so select the artifact from `dpkg --print-architecture` and install it directly to /usr/local/bin. On x86_64 this is equivalent to the previous installer invocation: the installer's only effect here was to place the same bazel binary on PATH. --- ml_metadata/tools/docker_server/Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ml_metadata/tools/docker_server/Dockerfile b/ml_metadata/tools/docker_server/Dockerfile index 52cbff8f5..9d076b407 100644 --- a/ml_metadata/tools/docker_server/Dockerfile +++ b/ml_metadata/tools/docker_server/Dockerfile @@ -40,13 +40,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ENV BAZEL_VERSION 7.7.0 WORKDIR / RUN mkdir /bazel && \ - cd /bazel && \ - curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ - curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \ - chmod +x bazel-*.sh && \ - ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ - cd / && \ - rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh + ARCH=$(dpkg --print-architecture) && \ + curl -H "User-Agent: Mozilla/5.0" -fSsL -o /usr/local/bin/bazel \ + https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-${ARCH} && \ + curl -H "User-Agent: Mozilla/5.0" -fSsL -o /bazel/LICENSE.txt \ + https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \ + chmod +x /usr/local/bin/bazel ADD . /mlmd-src WORKDIR /mlmd-src