Skip to content

Commit 6448131

Browse files
[𝘀𝗽𝗿] initial version
Created using spr 1.3.4
2 parents 0c0aa56 + 4501f50 commit 6448131

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed

.github/workflows/libcxx-build-containers.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636

3737
- name: Build the Linux builder image
3838
working-directory: libcxx/utils/ci
39-
run: docker compose build actions-builder
39+
run: |
40+
docker compose build builder-base
41+
docker compose build actions-builder
4042
env:
4143
TAG: ${{ github.sha }}
4244

@@ -57,6 +59,7 @@ jobs:
5759
if: github.event_name == 'push'
5860
working-directory: libcxx/utils/ci
5961
run: |
62+
docker compose push builder-base
6063
docker compose push actions-builder
6164
env:
6265
TAG: ${{ github.sha }}

libcxx/utils/ci/Dockerfile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# If you're only looking to run the Docker image locally for debugging a
3939
# build bot, see the `run-buildbot-container` script located in this directory.
4040

41+
ARG ACTIONS_BASE_IMAGE
4142

4243
# HACK: We set the base image in the docker-compose file depending on the final target (buildkite vs github actions).
4344
# This means we have a much slower container build, but we can use the same Dockerfile for both targets.
@@ -310,7 +311,20 @@ CMD /opt/android/container-setup.sh && buildkite-agent start
310311
#
311312
# IMAGE: ghcr.io/libcxx/actions-builder.
312313
#
313-
FROM builder-base AS actions-builder
314-
315-
WORKDIR /home/runner
316-
USER runner
314+
FROM $ACTIONS_BASE_IMAGE AS actions-builder
315+
316+
ARG GITHUB_RUNNER_VERSION
317+
318+
RUN useradd gha -u 1001 -m -s /bin/bash
319+
RUN adduser gha sudo
320+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
321+
WORKDIR /home/gha
322+
USER gha
323+
324+
ENV RUNNER_MANUALLY_TRAP_SIG=1
325+
ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1
326+
RUN mkdir actions-runner && \
327+
cd actions-runner && \
328+
curl -O -L https://github.com/actions/runner/releases/download/v$GITHUB_RUNNER_VERSION/actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
329+
tar xzf ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
330+
rm ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz

libcxx/utils/ci/docker-compose.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,26 @@ x-versions: &compiler_versions
33
LLVM_HEAD_VERSION: 21
44

55
services:
6+
builder-base:
7+
image: ghcr.io/llvm/libcxx-linux-builder-base:${TAG}
8+
build:
9+
context: .
10+
dockerfile: Dockerfile
11+
target: builder-base
12+
args:
13+
BASE_IMAGE: ubuntu:jammy
14+
<<: *compiler_versions
15+
616
actions-builder:
717
image: ghcr.io/llvm/libcxx-linux-builder:${TAG}
818
build:
919
context: .
1020
dockerfile: Dockerfile
1121
target: actions-builder
1222
args:
13-
BASE_IMAGE: ghcr.io/actions/actions-runner:2.326.0
23+
BASE_IMAGE: ubuntu:jammy
24+
ACTIONS_BASE_IMAGE: builder-base
25+
GITHUB_RUNNER_VERSION: "2.326.0"
1426
<<: *compiler_versions
1527

1628
android-buildkite-builder:

0 commit comments

Comments
 (0)