Skip to content

Commit 0779707

Browse files
committed
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.
1 parent be943b8 commit 0779707

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

ml_metadata/tools/docker_server/Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
4040
ENV BAZEL_VERSION 7.7.0
4141
WORKDIR /
4242
RUN mkdir /bazel && \
43-
cd /bazel && \
44-
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 && \
45-
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 && \
46-
chmod +x bazel-*.sh && \
47-
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
48-
cd / && \
49-
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
43+
ARCH=$(dpkg --print-architecture) && \
44+
curl -H "User-Agent: Mozilla/5.0" -fSsL -o /usr/local/bin/bazel \
45+
https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-${ARCH} && \
46+
curl -H "User-Agent: Mozilla/5.0" -fSsL -o /bazel/LICENSE.txt \
47+
https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \
48+
chmod +x /usr/local/bin/bazel
5049

5150
ADD . /mlmd-src
5251
WORKDIR /mlmd-src

0 commit comments

Comments
 (0)