@@ -106,6 +106,7 @@ RUN sudo apt-get update \
106106#RUN apt-get update && apt-get install -y ninja-build python3 python3-distutils python3-psutil git gdb ccache
107107# TODO add ninja-build once 1.11 is available in Ubuntu, also remove the manual installation.
108108RUN <<EOF
109+ set -e
109110 wget -qO /tmp/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip
110111 gunzip /tmp/ninja.gz
111112 chmod a+x /tmp/ninja
115116
116117# These two locales are not enabled by default so generate them
117118RUN <<EOF
119+ set -e
118120 printf "fr_CA ISO-8859-1\ncs_CZ ISO-8859-2" | sudo tee -a /etc/locale.gen
119121 sudo mkdir /usr/local/share/i1en/
120122 printf "fr_CA ISO-8859-1\ncs_CZ ISO-8859-2" | sudo tee -a /usr/local/share/i1en/SUPPORTED
129131# 14 release branch CI uses it. The tip-of-trunk CI will never use Clang 12,
130132# though.
131133RUN <<EOF
134+ set -e
132135 sudo apt-get update
133136 wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
134137 chmod +x /tmp/llvm.sh
142145
143146# Install the most recent GCC, like clang install the previous version as a transition.
144147RUN <<EOF
148+ set -e
145149 sudo git clone https://github.com/compiler-explorer/infra.git /tmp/ce-infra
146150 (cd /tmp/ce-infra && sudo make ce)
147151 sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $GCC_LATEST_VERSION.1.0
@@ -155,13 +159,14 @@ EOF
155159
156160RUN <<EOF
157161 # Install a recent CMake
162+ set -e
158163 wget https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.sh -O /tmp/install-cmake.sh
159164 sudo bash /tmp/install-cmake.sh --prefix=/usr --exclude-subdir --skip-license
160165 rm /tmp/install-cmake.sh
161166EOF
162167
163168# ===----------------------------------------------------------------------===##
164- # Android Buildkite Image
169+ # Android Builder Base Image
165170# ===----------------------------------------------------------------------===##
166171
167172FROM ubuntu:jammy AS android-builder-base
@@ -170,10 +175,11 @@ ARG ANDROID_CLANG_VERSION
170175ARG ANDROID_CLANG_PREBUILTS_COMMIT
171176ARG ANDROID_SYSROOT_BID
172177
173- RUN apt-get update && apt-get install -y curl unzip git
178+ RUN apt-get update && apt-get install -y curl bzip2 git unzip
174179
175180# Install the Android platform tools (e.g. adb) into /opt/android/sdk.
176181RUN <<EOF
182+ set -e
177183 mkdir -p /opt/android/sdk
178184 cd /opt/android/sdk
179185 curl -LO https://dl.google.com/android/repository/platform-tools-latest-linux.zip
187193ENV ANDROID_CLANG_VERSION=$ANDROID_CLANG_VERSION
188194ENV ANDROID_CLANG_PREBUILTS_COMMIT=$ANDROID_CLANG_PREBUILTS_COMMIT
189195RUN <<EOF
196+ set -e
190197 git clone --filter=blob:none --sparse \
191198 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 \
192199 /opt/android/clang
@@ -206,26 +213,14 @@ EOF
206213
207214ENV ANDROID_SYSROOT_BID=$ANDROID_SYSROOT_BID
208215RUN <<EOF
216+ set -e
209217 cd /opt/android
210218 curl -L -o ndk_platform.tar.bz2 \
211219 https://androidbuildinternal.googleapis.com/android/internal/build/v3/builds/${ANDROID_SYSROOT_BID}/ndk/attempts/latest/artifacts/ndk_platform.tar.bz2/url
212220 tar xf ndk_platform.tar.bz2
213221 rm ndk_platform.tar.bz2
214222EOF
215223
216- # Install Docker
217- RUN <<EOF
218- curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
219- sh /tmp/get-docker.sh
220- rm /tmp/get-docker.sh
221-
222- # Install Docker. Mark the binary setuid so it can be run without prefixing it
223- # with sudo. Adding the container user to the docker group doesn't work because
224- # /var/run/docker.sock is owned by the host's docker GID, not the container's
225- # docker GID.
226- chmod u+s /usr/bin/docker
227- EOF
228-
229224# ===----------------------------------------------------------------------===##
230225# Buildkite Builder Image
231226# ===----------------------------------------------------------------------===##
@@ -243,6 +238,7 @@ WORKDIR /home/libcxx-builder
243238# Install the Buildkite agent and dependencies. This must be done as non-root
244239# for the Buildkite agent to be installed in a path where we can find it.
245240RUN <<EOF
241+ set -e
246242 cd /home/libcxx-builder
247243 curl -sL https://raw.githubusercontent.com/buildkite/agent/main/install.sh -o /tmp/install-agent.sh
248244 bash /tmp/install-agent.sh
@@ -271,6 +267,22 @@ COPY ./vendor/android/container-setup.sh /opt/android/container-setup.sh
271267
272268ENV PATH="/opt/android/sdk/platform-tools:${PATH}"
273269
270+ USER root
271+
272+ # Install Docker
273+ RUN <<EOF
274+ set -e
275+ curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
276+ sh /tmp/get-docker.sh
277+ rm /tmp/get-docker.sh
278+
279+ # Install Docker. Mark the binary setuid so it can be run without prefixing it
280+ # with sudo. Adding the container user to the docker group doesn't work because
281+ # /var/run/docker.sock is owned by the host's docker GID, not the container's
282+ # docker GID.
283+ chmod u+s /usr/bin/docker
284+ EOF
285+
274286USER libcxx-builder
275287WORKDIR /home/libcxx-builder
276288
0 commit comments