Debian Codegraph @

libcxx/utils/ci/docker/linux-builder.dockerfile

raw
1 # ===----------------------------------------------------------------------===##
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 #
7 # ===----------------------------------------------------------------------===##
8 #
9 # This file defines the image we use for Linux testing using Github Actions.
10 # From the root of the monorepo, this image can be built with:
11 #
12 # $ docker build --file libcxx/utils/ci/docker/linux-builder.dockerfile \
13 # --build-arg BASE_IMAGE_VERSION=<sha> \
14 # --build-arg GITHUB_RUNNER_VERSION=<version> .
15 #
16 # This image also gets built on every push to `main` that modifies these Docker
17 # files, and can be found at ghcr.io/llvm/libcxx-linux-builder.
18
19 ARG BASE_IMAGE_VERSION
20 FROM ghcr.io/llvm/libcxx-linux-builder-base:${BASE_IMAGE_VERSION}
21
22 ARG GITHUB_RUNNER_VERSION
23
24 # Setup the user
25 RUN useradd gha -u 1001 -m -s /bin/bash
26 RUN adduser gha sudo
27 RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
28 WORKDIR /home/gha
29 USER gha
30
31 # Install the Github Actions runner
32 ENV RUNNER_MANUALLY_TRAP_SIG=1
33 ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1
34 RUN mkdir actions-runner && \
35 cd actions-runner && \
36 curl -O -L https://github.com/actions/runner/releases/download/v$GITHUB_RUNNER_VERSION/actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
37 tar xzf ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
38 rm ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz