Skip to content

Commit 3bc0861

Browse files
authored
Add Dockerfile for ubuntu2404 (#2055)
Other changes: - Removed building ubuntu1604 - Installed vim on ubuntu2004, ubuntu2204 and ubuntu2404 - Updated the build.sh and push.sh to avoid centos since it's no longer buildable. (https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm is 404)
1 parent 14a0378 commit 3bc0861

File tree

6 files changed

+119
-25
lines changed

6 files changed

+119
-25
lines changed

buildkite/docker/build.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,26 @@ esac
1919
export DOCKER_BUILDKIT=1
2020

2121
# Containers used by Bazel CI
22-
docker build -f centos7/Dockerfile --target centos7 -t "gcr.io/$PREFIX/centos7" centos7 &
22+
# docker build -f centos7/Dockerfile --target centos7 -t "gcr.io/$PREFIX/centos7" centos7 &
2323
docker build -f debian10/Dockerfile --target debian10-java11 -t "gcr.io/$PREFIX/debian10-java11" debian10 &
2424
docker build -f debian11/Dockerfile --target debian11-java17 -t "gcr.io/$PREFIX/debian11-java17" debian11 &
25-
docker build -f ubuntu1604/Dockerfile --target ubuntu1604-java8 -t "gcr.io/$PREFIX/ubuntu1604-java8" ubuntu1604 &
2625
docker build -f ubuntu1804/Dockerfile --target ubuntu1804-java11 -t "gcr.io/$PREFIX/ubuntu1804-java11" ubuntu1804 &
2726
docker build -f ubuntu2004/Dockerfile --target ubuntu2004-java11 -t "gcr.io/$PREFIX/ubuntu2004-java11" ubuntu2004 &
2827
docker build -f ubuntu2004/Dockerfile --target ubuntu2004 -t "gcr.io/$PREFIX/ubuntu2004" ubuntu2004 &
2928
docker build -f ubuntu2204/Dockerfile --target ubuntu2204-java17 -t "gcr.io/$PREFIX/ubuntu2204-java17" ubuntu2204 &
3029
docker build -f ubuntu2204/Dockerfile --target ubuntu2204 -t "gcr.io/$PREFIX/ubuntu2204" ubuntu2204 &
30+
docker build -f ubuntu2404/Dockerfile --target ubuntu2404 -t "gcr.io/$PREFIX/ubuntu2404" ubuntu2404 &
3131
docker build -f fedora39/Dockerfile --target fedora39-java17 -t "gcr.io/$PREFIX/fedora39-java17" fedora39 &
3232
docker build -f fedora40/Dockerfile --target fedora40-java21 -t "gcr.io/$PREFIX/fedora40-java21" fedora40 &
3333
wait
3434

35-
docker build -f centos7/Dockerfile --target centos7-java8 -t "gcr.io/$PREFIX/centos7-java8" centos7
36-
docker build -f centos7/Dockerfile --target centos7-java11 -t "gcr.io/$PREFIX/centos7-java11" centos7
37-
docker build -f centos7/Dockerfile --target centos7-java11-devtoolset10 -t "gcr.io/$PREFIX/centos7-java11-devtoolset10" centos7
38-
docker build -f centos7/Dockerfile --target centos7-releaser -t "gcr.io/$PREFIX/centos7-releaser" centos7
39-
docker build -f ubuntu1604/Dockerfile --target ubuntu1604-bazel-java8 -t "gcr.io/$PREFIX/ubuntu1604-bazel-java8" ubuntu1604
35+
# docker build -f centos7/Dockerfile --target centos7-java11 -t "gcr.io/$PREFIX/centos7-java11" centos7
36+
# docker build -f centos7/Dockerfile --target centos7-java11-devtoolset10 -t "gcr.io/$PREFIX/centos7-java11-devtoolset10" centos7
37+
# docker build -f centos7/Dockerfile --target centos7-releaser -t "gcr.io/$PREFIX/centos7-releaser" centos7
4038
docker build -f ubuntu1804/Dockerfile --target ubuntu1804-bazel-java11 -t "gcr.io/$PREFIX/ubuntu1804-bazel-java11" ubuntu1804
4139
docker build -f ubuntu2004/Dockerfile --target ubuntu2004-bazel-java11 -t "gcr.io/$PREFIX/ubuntu2004-bazel-java11" ubuntu2004
4240
docker build -f ubuntu2204/Dockerfile --target ubuntu2204-kythe -t "gcr.io/$PREFIX/ubuntu2204-kythe" ubuntu2204
4341
docker build -f ubuntu2204/Dockerfile --target ubuntu2204-bazel-java17 -t "gcr.io/$PREFIX/ubuntu2204-bazel-java17" ubuntu2204
42+
docker build -f ubuntu2404/Dockerfile --target ubuntu2404-kythe -t "gcr.io/$PREFIX/ubuntu2404-kythe" ubuntu2404
4443
docker build -f fedora39/Dockerfile --target fedora39-bazel-java17 -t "gcr.io/$PREFIX/fedora39-bazel-java17" fedora39
4544
docker build -f fedora40/Dockerfile --target fedora40-bazel-java21 -t "gcr.io/$PREFIX/fedora40-bazel-java21" fedora40

buildkite/docker/push.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,23 @@ case $(git symbolic-ref --short HEAD) in
1515
esac
1616

1717
# Containers used by Bazel CI
18-
docker push "gcr.io/$PREFIX/centos7" &
19-
docker push "gcr.io/$PREFIX/centos7-java8" &
20-
docker push "gcr.io/$PREFIX/centos7-java11" &
21-
docker push "gcr.io/$PREFIX/centos7-java11-devtoolset10" &
22-
docker push "gcr.io/$PREFIX/centos7-releaser" &
18+
# docker push "gcr.io/$PREFIX/centos7" &
19+
# docker push "gcr.io/$PREFIX/centos7-java11" &
20+
# docker push "gcr.io/$PREFIX/centos7-java11-devtoolset10" &
21+
# docker push "gcr.io/$PREFIX/centos7-releaser" &
2322
docker push "gcr.io/$PREFIX/debian10-java11" &
2423
docker push "gcr.io/$PREFIX/debian11-java17" &
25-
docker push "gcr.io/$PREFIX/ubuntu1604-bazel-java8" &
26-
docker push "gcr.io/$PREFIX/ubuntu1604-java8" &
2724
docker push "gcr.io/$PREFIX/ubuntu1804-bazel-java11" &
2825
docker push "gcr.io/$PREFIX/ubuntu1804-java11" &
2926
docker push "gcr.io/$PREFIX/ubuntu2004-bazel-java11" &
3027
docker push "gcr.io/$PREFIX/ubuntu2004-java11" &
31-
docker push "gcr.io/$PREFIX/ubuntu2204-kythe" &
3228
docker push "gcr.io/$PREFIX/ubuntu2004" &
3329
docker push "gcr.io/$PREFIX/ubuntu2204-java17" &
30+
docker push "gcr.io/$PREFIX/ubuntu2204-kythe" &
3431
docker push "gcr.io/$PREFIX/ubuntu2204-bazel-java17" &
3532
docker push "gcr.io/$PREFIX/ubuntu2204" &
33+
docker push "gcr.io/$PREFIX/ubuntu2404" &
34+
docker push "gcr.io/$PREFIX/ubuntu2404-kythe" &
3635
docker push "gcr.io/$PREFIX/fedora39-java17" &
3736
docker push "gcr.io/$PREFIX/fedora39-bazel-java17" &
3837
docker push "gcr.io/$PREFIX/fedora40-java21" &

buildkite/docker/ubuntu2004/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ RUN apt-get -y update && \
4646
software-properties-common \
4747
sudo \
4848
unzip \
49+
vim \
4950
wget \
5051
zip \
5152
zlib1g-dev \

buildkite/docker/ubuntu2204/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ RUN apt-get -y update && \
4747
software-properties-common \
4848
sudo \
4949
unzip \
50+
vim \
5051
wget \
5152
zip \
5253
zlib1g-dev \
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
FROM ubuntu:24.04 as ubuntu2404-bazel-nojdk
2+
ARG BUILDARCH
3+
4+
ENV DEBIAN_FRONTEND="noninteractive"
5+
ENV LANG "C.UTF-8"
6+
ENV LANGUAGE "C.UTF-8"
7+
ENV LC_ALL "C.UTF-8"
8+
9+
### Install packages required by Bazel and its tests
10+
RUN apt-get -y update && \
11+
apt-get -y install --no-install-recommends \
12+
apt-utils \
13+
bind9-host \
14+
build-essential \
15+
clang \
16+
coreutils \
17+
curl \
18+
dnsutils \
19+
ed \
20+
expect \
21+
file \
22+
git \
23+
gnupg2 \
24+
iproute2 \
25+
iputils-ping \
26+
lcov \
27+
less \
28+
libc++-dev \
29+
libssl-dev \
30+
llvm \
31+
llvm-dev \
32+
lsb-release \
33+
netcat-openbsd \
34+
openssh-client \
35+
python-is-python3 \
36+
python3 \
37+
python3-dev \
38+
python3-pip \
39+
python3-requests \
40+
python3-setuptools \
41+
python3-six \
42+
python3-wheel \
43+
python3-yaml \
44+
software-properties-common \
45+
sudo \
46+
unzip \
47+
vim \
48+
wget \
49+
zip \
50+
zlib1g-dev \
51+
&& \
52+
apt-get -y purge apport && \
53+
rm -rf /var/lib/apt/lists/*
54+
55+
# Allow using sudo inside the container.
56+
RUN echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
57+
58+
FROM ubuntu2404-bazel-nojdk AS ubuntu2404-nojdk
59+
60+
### Install Google Cloud SDK.
61+
### https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
62+
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 && \
63+
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
64+
apt-get update -y && apt-get install google-cloud-sdk -y && \
65+
rm -rf /var/lib/apt/lists/*
66+
67+
# Bazelisk
68+
RUN LATEST_BAZELISK=$(curl -sSI https://github.com/bazelbuild/bazelisk/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
69+
curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/${LATEST_BAZELISK}/bazelisk-linux-${BUILDARCH} && \
70+
chown root:root /usr/local/bin/bazel && \
71+
chmod 0755 /usr/local/bin/bazel
72+
73+
# Buildifier
74+
RUN LATEST_BUILDIFIER=$(curl -sSI https://github.com/bazelbuild/buildtools/releases/latest | grep -i '^location: ' | sed 's|.*/||' | sed $'s/\r//') && \
75+
curl -Lo /usr/local/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/${LATEST_BUILDIFIER}/buildifier-linux-${BUILDARCH} && \
76+
chown root:root /usr/local/bin/buildifier && \
77+
chmod 0755 /usr/local/bin/buildifier
78+
79+
FROM ubuntu2404-nojdk AS ubuntu2404
80+
81+
RUN apt-get -y update && \
82+
apt-get -y install openjdk-21-jdk-headless && \
83+
rm -rf /var/lib/apt/lists/*
84+
85+
ENV JAVA_HOME /usr/lib/jvm/java-21-openjdk-${BUILDARCH}
86+
87+
FROM ubuntu2404 AS ubuntu2404-kythe
88+
89+
# kythe 0.0.67 requires GLIBCXX_3.4.32 which isn't available on ubuntu 22.04 by default.
90+
# Using a test toolchain
91+
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && \
92+
apt-get -y update && \
93+
apt-get -y install --only-upgrade libstdc++6 && \
94+
rm -rf /var/lib/apt/lists/*
95+
96+
RUN LATEST_KYTHE=v0.0.67 && \
97+
mkdir /usr/local/kythe && \
98+
curl -fsSL https://github.com/kythe/kythe/releases/download/${LATEST_KYTHE}/kythe-{$LATEST_KYTHE}.tar.gz | \
99+
tar xvz --no-same-owner --strip-components 1 --directory /usr/local/kythe && \
100+
chmod -R a+rw /usr/local/kythe && \
101+
test -f /usr/local/kythe/WORKSPACE

buildkite/setup-docker.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,26 +216,19 @@ systemctl start docker
216216
gcloud auth configure-docker --quiet
217217

218218
### Pull the Docker images that we need in production.
219-
docker pull "gcr.io/bazel-public/centos7" &
220-
docker pull "gcr.io/bazel-public/centos7-java8" &
221-
docker pull "gcr.io/bazel-public/centos7-java11" &
222219
docker pull "gcr.io/bazel-public/centos7-java11-devtoolset10" &
223220
docker pull "gcr.io/bazel-public/centos7-releaser" &
224221
docker pull "gcr.io/bazel-public/debian10-java11" &
225222
docker pull "gcr.io/bazel-public/debian11-java17" &
226-
docker pull "gcr.io/bazel-public/ubuntu1604-bazel-java8" &
227-
docker pull "gcr.io/bazel-public/ubuntu1604-java8" &
228-
docker pull "gcr.io/bazel-public/ubuntu1804-bazel-java11" &
229223
docker pull "gcr.io/bazel-public/ubuntu1804-java11" &
230224
docker pull "gcr.io/bazel-public/ubuntu2004" &
231-
docker pull "gcr.io/bazel-public/ubuntu2004-bazel-java11" &
232-
docker pull "gcr.io/bazel-public/ubuntu2004-java11" &
233225
docker pull "gcr.io/bazel-public/ubuntu2004-java11-kythe" &
234226
docker pull "gcr.io/bazel-public/ubuntu2204" &
235227
docker pull "gcr.io/bazel-public/ubuntu2204-java17" &
236-
docker pull "gcr.io/bazel-public/ubuntu2204-bazel-java17" &
228+
docker pull "gcr.io/bazel-public/ubuntu2404" &
229+
docker pull "gcr.io/bazel-public/ubuntu2404-kythe" &
237230
docker pull "gcr.io/bazel-public/fedora39-java17" &
238-
docker pull "gcr.io/bazel-public/fedora39-bazel-java17" &
231+
docker pull "gcr.io/bazel-public/fedora40-java21" &
239232
wait
240233

241234
poweroff

0 commit comments

Comments
 (0)