xref: /aosp_15_r20/external/grpc-grpc/templates/tools/dockerfile/bazel.include (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1#========================
2# Bazel installation
3
4# Must be in sync with tools/bazel
5ENV BAZEL_VERSION ${primary_bazel_version}
6
7# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
8ENV DISABLE_BAZEL_WRAPPER 1
9
10# Download the correct bazel version and make sure it's on path.
11RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" ${'\\'}
12  && curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" ${'\\'}
13  && chmod a+x /usr/local/bin/bazel
14
15# Normally we would run "bazel --version" here to make sure bazel
16# was correctly installed, but we can't do that because
17# of # https://github.com/bazelbuild/bazel/issues/11379.
18# We want to keep the arm64 version of the image buildable
19# on x64 with use of qemu-user-static & binfmt emulation,
20# but the self-extraction is broken for bazel currently.
21# The binary will work correctly when run on real arm64
22# hardware, when qemu-user-static isn't getting into the way.
23