Add Dockerfile for ubuntu2604 with Java 25 (#3033) Adds a Ubuntu 26.04 CI image with OpenJDK 25, mirroring the existing ubuntu2404 image: a multi-arch (amd64/arm64) `ubuntu2604` build plus an amd64-only `ubuntu2604-kythe` variant (Kythe v0.0.75 ships only an x86-64 tarball), wired into `build.sh` and `push.sh`. This is the image-only step (as with ubuntu2404 #2055 / fedora45 #2983). Pinning the published digest in `bazelci.py`'s `IMAGE_HASHES`, registering the `ubuntu2604` platform, and switching the Gerrit pipeline follow in a separate PR once the image is pushed and its digest is known (`get_docker_image()` requires a digest). Notable 26.04 deltas vs 24.04: - OpenJDK 21 → 25 (`openjdk-25-jdk-headless`, `JAVA_HOME` under `java-25-openjdk`). - Google Cloud CLI key step: `apt-key` (removed in APT 3.2) → `gpg --dearmor`, over https. Verified on a Linux/amd64 server: the base image builds, `bazel build release` and the Gerrit test suite run inside it, the `ubuntu2604-kythe` image builds, and the Kythe binaries run (`kzip` plus the dynamically-linked `cxx_extractor` resolve their libraries on 26.04). Co-authored-by: Salma Samy <16399431+SalmaSamy@users.noreply.github.com>
diff --git a/buildkite/docker/build.sh b/buildkite/docker/build.sh index db4ebc6..340f9f9 100755 --- a/buildkite/docker/build.sh +++ b/buildkite/docker/build.sh
@@ -93,6 +93,7 @@ docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2204/Dockerfile --builder mp-builder --load --platform=linux/amd64,linux/arm64 --target ubuntu2204-java17 -t "gcr.io/$PREFIX/ubuntu2204-java17" ubuntu2204 & pids+=($!) docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2204/Dockerfile --builder mp-builder --load --platform=linux/amd64,linux/arm64 --target ubuntu2204 -t "gcr.io/$PREFIX/ubuntu2204" ubuntu2204 & pids+=($!) docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2404/Dockerfile --builder mp-builder --load --platform=linux/amd64,linux/arm64 --target ubuntu2404 -t "gcr.io/$PREFIX/ubuntu2404" ubuntu2404 & pids+=($!) +docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2604/Dockerfile --builder mp-builder --load --platform=linux/amd64,linux/arm64 --target ubuntu2604 -t "gcr.io/$PREFIX/ubuntu2604" ubuntu2604 & pids+=($!) docker_build "${TOOLS_CONTEXT[@]}" -f fedora43/Dockerfile --target fedora43-java25 -t "gcr.io/$PREFIX/fedora43-java25" fedora43 & pids+=($!) docker_build "${TOOLS_CONTEXT[@]}" -f fedora45/Dockerfile --target fedora45-java25 -t "gcr.io/$PREFIX/fedora45-java25" fedora45 & pids+=($!) docker_build "${TOOLS_CONTEXT[@]}" -f ../../docgen/Dockerfile -t "gcr.io/$PREFIX/docgen" ../../docgen & pids+=($!) @@ -108,5 +109,8 @@ docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2204/Dockerfile --builder mp-builder --load --platform=linux/amd64,linux/arm64 --target ubuntu2204-kythe -t "gcr.io/$PREFIX/ubuntu2204-kythe" ubuntu2204 docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2204/Dockerfile --builder mp-builder --load --platform=linux/amd64,linux/arm64 --target ubuntu2204-bazel-java17 -t "gcr.io/$PREFIX/ubuntu2204-bazel-java17" ubuntu2204 docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2404/Dockerfile --builder mp-builder --load --platform=linux/amd64,linux/arm64 --target ubuntu2404-kythe -t "gcr.io/$PREFIX/ubuntu2404-kythe" ubuntu2404 +# amd64-only: the pinned Kythe v0.0.75 release ships a single x86-64 tarball, so +# there is no arm64 variant to build (the base ubuntu2604 image above stays multi-arch). +docker_build "${TOOLS_CONTEXT[@]}" -f ubuntu2604/Dockerfile --builder mp-builder --load --platform=linux/amd64 --target ubuntu2604-kythe -t "gcr.io/$PREFIX/ubuntu2604-kythe" ubuntu2604 docker_build "${TOOLS_CONTEXT[@]}" -f fedora43/Dockerfile --target fedora43-bazel-java25 -t "gcr.io/$PREFIX/fedora43-bazel-java25" fedora43 docker_build "${TOOLS_CONTEXT[@]}" -f fedora45/Dockerfile --target fedora45-bazel-java25 -t "gcr.io/$PREFIX/fedora45-bazel-java25" fedora45
diff --git a/buildkite/docker/push.sh b/buildkite/docker/push.sh index 9326b82..af503c6 100755 --- a/buildkite/docker/push.sh +++ b/buildkite/docker/push.sh
@@ -17,6 +17,8 @@ docker push "gcr.io/$PREFIX/ubuntu2204" & docker push "gcr.io/$PREFIX/ubuntu2404" & docker push "gcr.io/$PREFIX/ubuntu2404-kythe" & +docker push "gcr.io/$PREFIX/ubuntu2604" & +docker push "gcr.io/$PREFIX/ubuntu2604-kythe" & docker push "gcr.io/$PREFIX/fedora43-java25" & docker push "gcr.io/$PREFIX/fedora45-java25" & docker push "gcr.io/$PREFIX/fedora43-bazel-java25" &
diff --git a/buildkite/docker/ubuntu2604/Dockerfile b/buildkite/docker/ubuntu2604/Dockerfile new file mode 100644 index 0000000..29576be --- /dev/null +++ b/buildkite/docker/ubuntu2604/Dockerfile
@@ -0,0 +1,99 @@ +FROM ubuntu:26.04 AS ubuntu2604-bazel-nojdk +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 \ + golang \ + iproute2 \ + iputils-ping \ + lcov \ + less \ + libclang-rt-dev \ + libc++-dev \ + libssl-dev \ + llvm \ + llvm-dev \ + lsb-release \ + locales \ + netcat-openbsd \ + openssh-client \ + python-is-python3 \ + python3 \ + python3-dev \ + python3-pip \ + python3-requests \ + python3-setuptools \ + python3-six \ + python3-wheel \ + python3-yaml \ + software-properties-common \ + sudo \ + unzip \ + vim \ + wget \ + zip \ + zlib1g-dev \ + && \ + apt-get -y purge apport && \ + rm -rf /var/lib/apt/lists/* + +# Allow using sudo inside the container. +RUN echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers + +# Ensure that Bazel can use its beloved ISO-8859-1 locale. +RUN localedef -i en_US -f ISO-8859-1 en_US.ISO-8859-1 + +FROM ubuntu2604-bazel-nojdk AS ubuntu2604-nojdk + +### Install Google Cloud CLI. +### https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu +### apt-key was removed in Ubuntu 26.04 (APT 3.2); use gpg --dearmor (gpg is already installed). +RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ + curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ + 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 + +FROM ubuntu2604-nojdk AS ubuntu2604 + +RUN apt-get -y update && \ + apt-get -y install openjdk-25-jdk-headless && \ + rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME /usr/lib/jvm/java-25-openjdk-${TARGETARCH} +# Authoritative target container image used by rules/rbe_config.bzl to automatically activate +# --exec_mode=host and prevent toolchain/ABI discrepancies in CI. +ENV RBE_CONFIG_CONTAINER="gcr.io/bazel-public/ubuntu2604:latest" + +FROM ubuntu2604 AS ubuntu2604-kythe + +RUN LATEST_KYTHE=v0.0.75 && \ + mkdir /usr/local/kythe && \ + curl -fsSL "https://github.com/kythe/kythe/releases/download/${LATEST_KYTHE}/kythe-${LATEST_KYTHE}.tar.gz" | \ + tar xvz --no-same-owner --strip-components 1 --directory /usr/local/kythe && \ + chmod -R a+rw /usr/local/kythe && \ + test -f /usr/local/kythe/WORKSPACE