| FROM debian:12 AS debian12-java17 | |
| ARG TARGETARCH | |
| ENV DEBIAN_FRONTEND="noninteractive" | |
| ENV LANG "C.UTF-8" | |
| ENV LANGUAGE "C.UTF-8" | |
| ENV LC_ALL "C.UTF-8" | |
| ### Install packages required by Bazel and its tests | |
| RUN apt-get -y update && \ | |
| apt-get -y install --no-install-recommends \ | |
| apt-utils \ | |
| bind9-host \ | |
| build-essential \ | |
| clang \ | |
| clang-tools \ | |
| coreutils \ | |
| curl \ | |
| dnsutils \ | |
| ed \ | |
| expect \ | |
| file \ | |
| git \ | |
| gnupg2 \ | |
| iproute2 \ | |
| iputils-ping \ | |
| lcov \ | |
| less \ | |
| libssl-dev \ | |
| llvm \ | |
| llvm-dev \ | |
| lsb-release \ | |
| netcat-openbsd \ | |
| openjdk-17-jdk-headless \ | |
| python3 \ | |
| python3-dev \ | |
| python3-pip \ | |
| python3-requests \ | |
| python3-setuptools \ | |
| python3-six \ | |
| python3-wheel \ | |
| python3-yaml \ | |
| software-properties-common \ | |
| sudo \ | |
| unzip \ | |
| wget \ | |
| xvfb \ | |
| zip \ | |
| zlib1g-dev \ | |
| && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Allow using sudo inside the container. | |
| RUN echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers | |
| ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-${TARGETARCH} | |
| ### Install Google Cloud CLI. | |
| RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ | |
| curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \ | |
| apt-get update -y && apt-get install google-cloud-cli -y && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Bazelisk | |
| COPY --from=tools --chmod=0755 bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel | |
| # Buildifier | |
| COPY --from=tools --chmod=0755 buildifier-linux-${TARGETARCH} /usr/local/bin/buildifier |