Louis Dionne | 52dc491 | 2024-09-04 20:47:20 | [diff] [blame^] | 1 | # ===----------------------------------------------------------------------===## |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 2 | # |
| 3 | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | # See https://llvm.org/LICENSE.txt for license information. |
| 5 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | # |
Louis Dionne | 52dc491 | 2024-09-04 20:47:20 | [diff] [blame^] | 7 | # ===----------------------------------------------------------------------===## |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 8 | # |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 9 | # This file defines the buildkite and github actions builder images. |
Mark de Wever | 3cf169c | 2024-03-25 17:53:55 | [diff] [blame] | 10 | # You can build both images using: |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 11 | # |
| 12 | # docker compose build |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 13 | # |
Mark de Wever | 3cf169c | 2024-03-25 17:53:55 | [diff] [blame] | 14 | # Or you can select a single image to build |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 15 | # |
| 16 | # docker compose build buildkite-builder |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 17 | # |
| 18 | # The final images can be found at |
| 19 | # |
| 20 | # ghcr.io/libcxx/buildkite-builder |
| 21 | # ghcr.io/libcxx/actions-builder |
| 22 | # ghcr.io/libcxx/android-buildkite-builder |
| 23 | # |
Mark de Wever | 3cf169c | 2024-03-25 17:53:55 | [diff] [blame] | 24 | # Members of the github.com/libcxx/ organizations can push new images to the CI. |
| 25 | # This is done by GitHub actions in the https://github.com/libcxx/builders repo. |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 26 | # |
| 27 | # ===----------------------------------------------------------------------===## |
| 28 | # Running the buildkite image |
| 29 | # ===----------------------------------------------------------------------===## |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 30 | # |
| 31 | # To start a Buildkite Agent, run it as: |
Louis Dionne | 4f7f728 | 2022-01-03 20:08:05 | [diff] [blame] | 32 | # $ docker run --env-file <secrets> -it $(docker build -q libcxx/utils/ci) |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 33 | # |
Louis Dionne | 9b371f5 | 2021-06-21 20:21:39 | [diff] [blame] | 34 | # The environment variables in `<secrets>` should be the ones necessary |
Louis Dionne | 2eab585 | 2023-03-25 17:55:04 | [diff] [blame] | 35 | # to run a BuildKite agent: |
| 36 | # |
| 37 | # BUILDKITE_AGENT_TOKEN=<token> |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 38 | # |
Louis Dionne | c5659dd | 2021-03-02 17:59:29 | [diff] [blame] | 39 | # If you're only looking to run the Docker image locally for debugging a |
| 40 | # build bot, see the `run-buildbot-container` script located in this directory. |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 41 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 42 | |
| 43 | # HACK: We set the base image in the docker-compose file depending on the final target (buildkite vs github actions). |
| 44 | # This means we have a much slower container build, but we can use the same Dockerfile for both targets. |
| 45 | ARG BASE_IMAGE |
| 46 | FROM $BASE_IMAGE AS builder-base |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 47 | |
Louis Dionne | 738d981 | 2020-11-05 20:13:27 | [diff] [blame] | 48 | # Make sure apt-get doesn't try to prompt for stuff like our time zone, etc. |
| 49 | ENV DEBIAN_FRONTEND=noninteractive |
| 50 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 51 | # populated in the docker-compose file |
| 52 | ARG GCC_LATEST_VERSION |
| 53 | ENV GCC_LATEST_VERSION=${GCC_LATEST_VERSION} |
| 54 | |
| 55 | # populated in the docker-compose file |
| 56 | ARG LLVM_HEAD_VERSION |
| 57 | ENV LLVM_HEAD_VERSION=${LLVM_HEAD_VERSION} |
| 58 | |
| 59 | # HACK: The github actions runner image already has sudo and requires its use. The buildkite base image does not. |
| 60 | # Reconcile this. |
| 61 | RUN <<EOF |
| 62 | apt-get update || true |
| 63 | apt-get install -y sudo || true |
| 64 | echo "ALL ALL = (ALL) NOPASSWD: ALL" | tee /etc/sudoers || true |
| 65 | EOF |
| 66 | |
Mark de Wever | af21659 | 2024-03-12 16:28:15 | [diff] [blame] | 67 | # Installing tzdata before other packages avoids the time zone prompts. |
| 68 | # These prompts seem to ignore DEBIAN_FRONTEND=noninteractive. |
| 69 | RUN sudo apt-get update \ |
| 70 | && sudo apt-get install -y \ |
| 71 | tzdata |
| 72 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 73 | RUN sudo apt-get update \ |
| 74 | && sudo apt-get install -y \ |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 75 | bash \ |
Mark de Wever | c174d8f | 2024-04-10 05:55:45 | [diff] [blame] | 76 | ccache \ |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 77 | curl \ |
Mark de Wever | c174d8f | 2024-04-10 05:55:45 | [diff] [blame] | 78 | gdb \ |
| 79 | git \ |
| 80 | gpg \ |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 81 | language-pack-en \ |
| 82 | language-pack-fr \ |
| 83 | language-pack-ja \ |
| 84 | language-pack-ru \ |
| 85 | language-pack-zh-hans \ |
Mark de Wever | c174d8f | 2024-04-10 05:55:45 | [diff] [blame] | 86 | libedit-dev \ |
| 87 | libncurses5-dev \ |
| 88 | libpython3-dev \ |
| 89 | libxml2-dev \ |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 90 | lsb-release \ |
Mark de Wever | c174d8f | 2024-04-10 05:55:45 | [diff] [blame] | 91 | make \ |
| 92 | python3 \ |
| 93 | python3-dev \ |
Louis Dionne | 881dc13 | 2024-06-19 15:19:55 | [diff] [blame] | 94 | python3-packaging \ |
Nikolas Klauser | f190343 | 2024-06-30 10:14:37 | [diff] [blame] | 95 | python3-setuptools \ |
Mark de Wever | c174d8f | 2024-04-10 05:55:45 | [diff] [blame] | 96 | python3-psutil \ |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 97 | software-properties-common \ |
Nikolas Klauser | f190343 | 2024-06-30 10:14:37 | [diff] [blame] | 98 | swig \ |
Mark de Wever | c174d8f | 2024-04-10 05:55:45 | [diff] [blame] | 99 | unzip \ |
| 100 | uuid-dev \ |
| 101 | wget \ |
Nikolas Klauser | 9ce895c | 2024-07-03 14:29:58 | [diff] [blame] | 102 | xz-utils \ |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 103 | && sudo rm -rf /var/lib/apt/lists/* |
| 104 | |
Louis Dionne | 2159ed8 | 2020-09-29 16:48:44 | [diff] [blame] | 105 | # Install various tools used by the build or the test suite |
Louis Dionne | 15f179e | 2023-10-24 12:06:21 | [diff] [blame] | 106 | #RUN apt-get update && apt-get install -y ninja-build python3 python3-distutils python3-psutil git gdb ccache |
Mark de Wever | a9ddb77 | 2023-03-15 07:07:05 | [diff] [blame] | 107 | # TODO add ninja-build once 1.11 is available in Ubuntu, also remove the manual installation. |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 108 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 109 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 110 | wget -qO /tmp/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip |
| 111 | gunzip /tmp/ninja.gz |
| 112 | chmod a+x /tmp/ninja |
| 113 | sudo mv /tmp/ninja /usr/local/bin/ninja |
| 114 | EOF |
Louis Dionne | 2159ed8 | 2020-09-29 16:48:44 | [diff] [blame] | 115 | |
Louis Dionne | 7ecd4d2 | 2022-09-12 14:51:07 | [diff] [blame] | 116 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 117 | # These two locales are not enabled by default so generate them |
| 118 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 119 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 120 | printf "fr_CA ISO-8859-1\ncs_CZ ISO-8859-2" | sudo tee -a /etc/locale.gen |
| 121 | sudo mkdir /usr/local/share/i1en/ |
| 122 | printf "fr_CA ISO-8859-1\ncs_CZ ISO-8859-2" | sudo tee -a /usr/local/share/i1en/SUPPORTED |
| 123 | sudo locale-gen |
| 124 | EOF |
David Spickett | da59376 | 2021-10-06 15:05:47 | [diff] [blame] | 125 | |
Louis Dionne | 8ea2b95 | 2021-07-08 16:19:53 | [diff] [blame] | 126 | # Install Clang <latest>, <latest-1> and ToT, which are the ones we support. |
Mark de Wever | a7bd1ab | 2022-05-30 16:34:15 | [diff] [blame] | 127 | # We also install <latest-2> because we need to support the "latest-1" of the |
| 128 | # current LLVM release branch, which is effectively the <latest-2> of the |
| 129 | # tip-of-trunk LLVM. For example, after branching LLVM 14 but before branching |
| 130 | # LLVM 15, we still need to have Clang 12 in this Docker image because the LLVM |
| 131 | # 14 release branch CI uses it. The tip-of-trunk CI will never use Clang 12, |
| 132 | # though. |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 133 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 134 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 135 | sudo apt-get update |
| 136 | wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh |
| 137 | chmod +x /tmp/llvm.sh |
| 138 | sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 3)) all # for CI transitions |
| 139 | sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 2)) all # previous release |
| 140 | sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 1)) all # latest release |
| 141 | sudo /tmp/llvm.sh $LLVM_HEAD_VERSION all # current ToT |
| 142 | sudo apt-get install -y libomp5-$LLVM_HEAD_VERSION |
| 143 | sudo rm -rf /var/lib/apt/lists/* |
| 144 | EOF |
Nikolas Klauser | f48f961 | 2022-11-25 17:25:05 | [diff] [blame] | 145 | |
Mark de Wever | a7bd1ab | 2022-05-30 16:34:15 | [diff] [blame] | 146 | # Install the most recent GCC, like clang install the previous version as a transition. |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 147 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 148 | set -e |
Nikolas Klauser | 9ce895c | 2024-07-03 14:29:58 | [diff] [blame] | 149 | sudo git clone https://github.com/compiler-explorer/infra.git /tmp/ce-infra |
| 150 | (cd /tmp/ce-infra && sudo make ce) |
| 151 | sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $GCC_LATEST_VERSION.1.0 |
| 152 | sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $((GCC_LATEST_VERSION - 1)).1.0 |
| 153 | sudo ln -s /opt/compiler-explorer/gcc-$GCC_LATEST_VERSION.1.0/bin/gcc /usr/bin/gcc-$GCC_LATEST_VERSION |
| 154 | sudo ln -s /opt/compiler-explorer/gcc-$GCC_LATEST_VERSION.1.0/bin/g++ /usr/bin/g++-$GCC_LATEST_VERSION |
| 155 | sudo ln -s /opt/compiler-explorer/gcc-$((GCC_LATEST_VERSION - 1)).1.0/bin/gcc /usr/bin/gcc-$((GCC_LATEST_VERSION - 1)) |
| 156 | sudo ln -s /opt/compiler-explorer/gcc-$((GCC_LATEST_VERSION - 1)).1.0/bin/g++ /usr/bin/g++-$((GCC_LATEST_VERSION - 1)) |
| 157 | sudo rm -rf /tmp/ce-infra |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 158 | EOF |
Louis Dionne | 8ea2b95 | 2021-07-08 16:19:53 | [diff] [blame] | 159 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 160 | RUN <<EOF |
| 161 | # Install a recent CMake |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 162 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 163 | wget https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-linux-x86_64.sh -O /tmp/install-cmake.sh |
| 164 | sudo bash /tmp/install-cmake.sh --prefix=/usr --exclude-subdir --skip-license |
| 165 | rm /tmp/install-cmake.sh |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 166 | EOF |
Mark de Wever | a9ddb77 | 2023-03-15 07:07:05 | [diff] [blame] | 167 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 168 | # ===----------------------------------------------------------------------===## |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 169 | # Android Builder Base Image |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 170 | # ===----------------------------------------------------------------------===## |
Mark de Wever | 3d131f9 | 2023-11-08 16:51:27 | [diff] [blame] | 171 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 172 | FROM ubuntu:jammy AS android-builder-base |
| 173 | |
| 174 | ARG ANDROID_CLANG_VERSION |
| 175 | ARG ANDROID_CLANG_PREBUILTS_COMMIT |
| 176 | ARG ANDROID_SYSROOT_BID |
| 177 | |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 178 | RUN apt-get update && apt-get install -y curl bzip2 git unzip |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 179 | |
| 180 | # Install the Android platform tools (e.g. adb) into /opt/android/sdk. |
| 181 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 182 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 183 | mkdir -p /opt/android/sdk |
| 184 | cd /opt/android/sdk |
| 185 | curl -LO https://dl.google.com/android/repository/platform-tools-latest-linux.zip |
| 186 | unzip platform-tools-latest-linux.zip |
| 187 | rm platform-tools-latest-linux.zip |
| 188 | EOF |
| 189 | |
| 190 | # Install the current Android compiler. Specify the prebuilts commit to retrieve |
| 191 | # this compiler version even after it's removed from HEAD. |
| 192 | |
| 193 | ENV ANDROID_CLANG_VERSION=$ANDROID_CLANG_VERSION |
| 194 | ENV ANDROID_CLANG_PREBUILTS_COMMIT=$ANDROID_CLANG_PREBUILTS_COMMIT |
| 195 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 196 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 197 | git clone --filter=blob:none --sparse \ |
| 198 | https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 \ |
| 199 | /opt/android/clang |
| 200 | git -C /opt/android/clang checkout ${ANDROID_CLANG_PREBUILTS_COMMIT} |
| 201 | git -C /opt/android/clang sparse-checkout add clang-${ANDROID_CLANG_VERSION} |
| 202 | rm -fr /opt/android/clang/.git |
| 203 | ln -sf /opt/android/clang/clang-${ANDROID_CLANG_VERSION} /opt/android/clang/clang-current |
| 204 | # The "git sparse-checkout" and "ln" commands succeed even if nothing was |
| 205 | # checked out, so use this "ls" command to fix that. |
| 206 | ls /opt/android/clang/clang-current/bin/clang |
| 207 | EOF |
| 208 | |
| 209 | # Install an Android sysroot. New AOSP sysroots are available at |
| 210 | # https://ci.android.com/builds/branches/aosp-main/grid, the "ndk" target. The |
| 211 | # NDK also makes its sysroot prebuilt available at |
| 212 | # https://android.googlesource.com/platform/prebuilts/ndk/+/refs/heads/dev/platform/sysroot. |
| 213 | |
| 214 | ENV ANDROID_SYSROOT_BID=$ANDROID_SYSROOT_BID |
| 215 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 216 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 217 | cd /opt/android |
| 218 | curl -L -o ndk_platform.tar.bz2 \ |
| 219 | https://androidbuildinternal.googleapis.com/android/internal/build/v3/builds/${ANDROID_SYSROOT_BID}/ndk/attempts/latest/artifacts/ndk_platform.tar.bz2/url |
| 220 | tar xf ndk_platform.tar.bz2 |
| 221 | rm ndk_platform.tar.bz2 |
| 222 | EOF |
| 223 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 224 | # ===----------------------------------------------------------------------===## |
| 225 | # Buildkite Builder Image |
| 226 | # ===----------------------------------------------------------------------===## |
| 227 | # |
| 228 | # IMAGE: ghcr.io/libcxx/buildkite-builder. |
| 229 | # |
| 230 | FROM builder-base AS buildkite-builder |
| 231 | |
| 232 | # Create the libcxx-builder user, regardless of if we use it or not |
| 233 | RUN sudo useradd --create-home libcxx-builder |
| 234 | |
Louis Dionne | 2159ed8 | 2020-09-29 16:48:44 | [diff] [blame] | 235 | USER libcxx-builder |
| 236 | WORKDIR /home/libcxx-builder |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 237 | |
Louis Dionne | 2159ed8 | 2020-09-29 16:48:44 | [diff] [blame] | 238 | # Install the Buildkite agent and dependencies. This must be done as non-root |
| 239 | # for the Buildkite agent to be installed in a path where we can find it. |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 240 | RUN <<EOF |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 241 | set -e |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 242 | cd /home/libcxx-builder |
| 243 | curl -sL https://raw.githubusercontent.com/buildkite/agent/main/install.sh -o /tmp/install-agent.sh |
| 244 | bash /tmp/install-agent.sh |
| 245 | rm /tmp/install-agent.sh |
| 246 | echo "tags=\"queue=libcxx-builders,arch=$(uname -m),os=linux\"" \ |
| 247 | >> /home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg |
| 248 | EOF |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 249 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 250 | USER libcxx-builder |
| 251 | WORKDIR /home/libcxx-builder |
| 252 | |
| 253 | ENV PATH="${PATH}:/home/libcxx-builder/.buildkite-agent/bin" |
| 254 | |
Eric | 601e8fd | 2023-11-10 13:24:39 | [diff] [blame] | 255 | CMD ["buildkite-agent", "start"] |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 256 | |
| 257 | # ===----------------------------------------------------------------------===## |
| 258 | # Android Buildkite Builder Image |
| 259 | # ===----------------------------------------------------------------------===## |
| 260 | # |
| 261 | # IMAGE: ghcr.io/libcxx/android-buildkite-builder. |
| 262 | # |
| 263 | FROM buildkite-builder AS android-buildkite-builder |
| 264 | |
| 265 | COPY --from=android-builder-base /opt/android /opt/android |
| 266 | COPY ./vendor/android/container-setup.sh /opt/android/container-setup.sh |
| 267 | |
| 268 | ENV PATH="/opt/android/sdk/platform-tools:${PATH}" |
| 269 | |
Ryan Prichard | d0c8e26 | 2024-07-23 20:28:36 | [diff] [blame] | 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 | |
Eric | f4e3fb5 | 2023-11-16 17:52:46 | [diff] [blame] | 286 | USER libcxx-builder |
| 287 | WORKDIR /home/libcxx-builder |
| 288 | |
| 289 | # Reset the configuration, we pass the configuration via the environment. |
| 290 | RUN cp /home/libcxx-builder/.buildkite-agent/buildkite-agent.dist.cfg \ |
| 291 | /home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg |
| 292 | |
| 293 | # Modify the Buildkite agent cmdline to do Android setup stuff first. |
| 294 | CMD /opt/android/container-setup.sh && buildkite-agent start |
| 295 | |
| 296 | # ===----------------------------------------------------------------------===## |
| 297 | # Github Actions Builder Image |
| 298 | # ===----------------------------------------------------------------------===## |
| 299 | # |
| 300 | # IMAGE: ghcr.io/libcxx/actions-builder. |
| 301 | # |
| 302 | FROM builder-base AS actions-builder |
| 303 | |
| 304 | WORKDIR /home/runner |
| 305 | USER runner |