Skip to content

Commit 02bd064

Browse files
boomanaiden154TIFitis
authored andcommitted
[libcxx] Install runner last when building CI containers
This patch changes when we install the GHA runner in the CI containers. Instead of having it in the base image, we install it last. This will enable a follow up patch that will do some setup enabling building the full container image with an existing base image, thus enabling updating the GHA runner without modifying the important bits. Reviewers: EricWF, ldionne Reviewed By: ldionne Pull Request: #148072
1 parent 9dded5e commit 02bd064

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

libcxx/utils/ci/Dockerfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,5 +311,18 @@ CMD /opt/android/container-setup.sh && buildkite-agent start
311311
#
312312
FROM builder-base AS actions-builder
313313

314-
WORKDIR /home/runner
315-
USER runner
314+
ARG GITHUB_RUNNER_VERSION
315+
316+
RUN useradd gha -u 1001 -m -s /bin/bash
317+
RUN adduser gha sudo
318+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
319+
WORKDIR /home/gha
320+
USER gha
321+
322+
ENV RUNNER_MANUALLY_TRAP_SIG=1
323+
ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1
324+
RUN mkdir actions-runner && \
325+
cd actions-runner && \
326+
curl -O -L https://github.com/actions/runner/releases/download/v$GITHUB_RUNNER_VERSION/actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
327+
tar xzf ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \
328+
rm ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz

libcxx/utils/ci/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ services:
1010
dockerfile: Dockerfile
1111
target: actions-builder
1212
args:
13-
BASE_IMAGE: ghcr.io/actions/actions-runner:2.326.0
13+
BASE_IMAGE: ubuntu:jammy
14+
GITHUB_RUNNER_VERSION: "2.326.0"
1415
<<: *compiler_versions
1516

1617
android-buildkite-builder:

0 commit comments

Comments
 (0)