aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKonstantin Bogomolov <bogomolov@google.com>2025-08-27 02:48:12 +0000
committerAleksandr Nogikh <nogikh@google.com>2025-08-28 08:39:12 +0000
commitbee60a83ac500de0590dfe108da76395d821092a (patch)
tree64712dc2710ff3e7f55b4e833e15f5a60e4a1cb4 /tools
parent1e8c3924f7d57db9cb37b9bd8c0e139b021bedf1 (diff)
tools/docker: install bazelisk instead of bazel
The needed Bazel version to build gVisor got bumped. However, instead of doing the same bump in two places whenever this happens, we can simply use bazelisk in syzkaller to determine which bazel version to use automatically.
Diffstat (limited to 'tools')
-rw-r--r--tools/docker/syzbot/Dockerfile9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/docker/syzbot/Dockerfile b/tools/docker/syzbot/Dockerfile
index 731759b3b..04d42de87 100644
--- a/tools/docker/syzbot/Dockerfile
+++ b/tools/docker/syzbot/Dockerfile
@@ -61,9 +61,12 @@ RUN apt-get install -y -q --no-install-recommends clang-15
# Not really GRTE, but it's enough to run some scripts that hardcode the path.
RUN mkdir -p /usr/grte/v5/bin && ln -s /usr/bin/python3 /usr/grte/v5/bin/python2.7
-# Install bazel
-# Download the official bazel binary. The APT repository isn't used because there is not packages for arm64.
-RUN sh -c 'curl -o /usr/local/bin/bazel https://releases.bazel.build/7.1.2/release/bazel-7.1.2-linux-$(uname -m | sed s/aarch64/arm64/) && chmod ugo+x /usr/local/bin/bazel'
+# Install bazelisk
+RUN curl -s https://api.github.com/repos/bazelbuild/bazelisk/releases/latest \
+ | sed -n '/browser_download_url/s/[^:]*:[^"]*\("[^"]*"\).*/url = \1/p' \
+ | grep bazelisk-linux-$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
+ | curl -L -o /usr/local/bin/bazel -K - \
+ && chmod +x /usr/local/bin/bazel
# Install qemu from the backports.
# The currently stable version (7.2) cannot properly run arm64-MTE kernels.