Skip to content

Commit bff9f6b

Browse files
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.
1 parent e12e5ba commit bff9f6b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/docker/syzbot/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ RUN apt-get install -y -q --no-install-recommends clang-15
6161
# Not really GRTE, but it's enough to run some scripts that hardcode the path.
6262
RUN mkdir -p /usr/grte/v5/bin && ln -s /usr/bin/python3 /usr/grte/v5/bin/python2.7
6363

64-
# Install bazel
65-
# Download the official bazel binary. The APT repository isn't used because there is not packages for arm64.
66-
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'
64+
# Install bazelisk
65+
RUN curl -s https://api.github.com/repos/bazelbuild/bazelisk/releases/latest \
66+
| sed -n '/browser_download_url/s/[^:]*:[^"]*\("[^"]*"\).*/url = \1/p' \
67+
| grep bazelisk-linux-$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \
68+
| curl -L -o /usr/local/bin/bazel -K - \
69+
&& chmod +x /usr/local/bin/bazel
6770

6871
# Install qemu from the backports.
6972
# The currently stable version (7.2) cannot properly run arm64-MTE kernels.

0 commit comments

Comments
 (0)