@@ -9,16 +9,24 @@ COPY --chown=ia-tests:ia-tests . /init-actions
99
1010# Install Bazel:
1111# https://docs.bazel.build/versions/master/install-ubuntu.html
12- ENV bazel_kr_path=/usr/share/keyrings/bazel-keyring.gpg
12+ ENV bazel_kr_path=/usr/share/keyrings/bazel-keyring.gpg \
13+ bazel_version=7.4.0 \
14+ bazel_repo_data="http://storage.googleapis.com/bazel-apt stable jdk1.8" \
15+ bazel_repo_file="/etc/apt/sources.list.d/bazel.list" \
16+ DEBIAN_FRONTEND=noninteractive
1317RUN apt-get install -y -qq curl >/dev/null 2>&1 && \
1418 apt-get clean
15- RUN /usr/bin/curl https://bazel.build/bazel-release.pub.gpg | \
16- gpg --dearmor -o "${bazel_kr_path}"
17- RUN echo "deb [arch=amd64 signed-by=${bazel_kr_path}] http://storage.googleapis.com/bazel-apt stable jdk1.8 " | \
18- dd of=/etc/apt/sources.list.d/bazel.list status=none && \
19+ RUN /usr/bin/curl -s https://bazel.build/bazel-release.pub.gpg | \
20+ gpg --import --no-default-keyring --keyring "${bazel_kr_path}" && \
21+ echo "deb [arch=amd64 signed-by=${bazel_kr_path}] ${bazel_repo_data} " | \
22+ dd of="${bazel_repo_file}" status=none && \
1923 apt-get update -qq
20- RUN apt-get autoremove -y -qq && \
21- apt-get install -y -qq openjdk-8- jdk python3-setuptools bazel > /dev/null 2>&1 && \
24+ RUN apt-get autoremove -y -qq > /dev/null 2>&1 && \
25+ apt-get install -y -qq default- jdk python3-setuptools bazel-${bazel_version} > /dev/null 2>&1 && \
2226 apt-get clean
2327
28+ # Set bazel-${bazel_version} as the default bazel alternative in this container
29+ RUN update-alternatives --install /usr/bin/bazel bazel /usr/bin/bazel-${bazel_version} 1 && \
30+ update-alternatives --set bazel /usr/bin/bazel-${bazel_version}
31+
2432USER ia-tests
0 commit comments