Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
94 lines (86 loc) · 4.68 KB
/
Copy pathDockerfile
File metadata and controls
94 lines (86 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# The tag and multi-platform index digest are intentionally both pinned. The
# official image is Ubuntu 24.04 and contains the exact runner binary named by
# the tag. This line is the runner pin's single source: Dependabot rewrites it,
# and scripts/ReleasePinSources.ps1 reads it for every release check.
FROM ghcr.io/actions/actions-runner:2.338.2@sha256:6d0b2d80d80f143f77dcb676e50920100bbb547e39e883454d57f45ab8c31300
ARG POWERSHELL_VERSION=7.6.9
ARG POWERSHELL_SHA256=1da6d6d6035d651f20e70ddee7c4c15ac6ab8b9fb40ee92240d91263f28a884b
ARG GH_VERSION=2.103.3
ARG GH_SHA256=4c806978ffce1cec70853302a56d70ac6da4f19bae7adca4e1a8ab00633dd91d
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Keep the compatibility layer deliberately small. Versioned language runtimes
# belong in their official setup actions so hosted and self-hosted workflows use
# the same declarations. PowerShell is installed from Microsoft's checksummed
# release asset because it is not in Ubuntu's first-party repository. The
# GitHub CLI is installed from its checksummed official release asset at the
# hosted-image manifest version; Ubuntu's archive carries a years-stale gh.
# bubblewrap and socat are fleet-only: the Claude review lanes need them and
# hosted Ubuntu 24.04 lacks them (docs/worker-image.md).
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
bubblewrap \
ca-certificates \
clang \
curl \
git \
git-lfs \
jq \
openssh-client \
socat \
sudo \
unzip \
zip \
zlib1g-dev \
zstd \
&& curl --fail --location --proto '=https' --tlsv1.2 \
--output /tmp/powershell.tar.gz \
"https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-x64.tar.gz" \
&& echo "${POWERSHELL_SHA256} /tmp/powershell.tar.gz" | sha256sum --check --strict \
&& install --directory --owner=root --group=root --mode=0755 /opt/microsoft/powershell/7 \
&& tar --extract --gzip --file=/tmp/powershell.tar.gz --directory=/opt/microsoft/powershell/7 \
&& chmod 0755 /opt/microsoft/powershell/7/pwsh \
&& ln --symbolic /opt/microsoft/powershell/7/pwsh /usr/local/bin/pwsh \
&& curl --fail --location --proto '=https' --tlsv1.2 \
--output /tmp/gh.tar.gz \
"https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz" \
&& echo "${GH_SHA256} /tmp/gh.tar.gz" | sha256sum --check --strict \
&& tar --extract --gzip --file=/tmp/gh.tar.gz --directory=/usr/local/bin \
--strip-components=2 "gh_${GH_VERSION}_linux_amd64/bin/gh" \
&& chmod 0755 /usr/local/bin/gh \
&& git lfs install --system \
&& install --directory --owner=runner --group=runner --mode=0755 \
/home/runner/.dotnet \
/home/runner/.dotnet/tools \
/home/runner/.nuget \
/home/runner/.nuget/packages \
&& rm --force /tmp/powershell.tar.gz /tmp/gh.tar.gz \
&& rm --recursive --force /var/lib/apt/lists/*
COPY --chmod=0555 worker/set-state.sh /usr/local/libexec/ci-runner-set-state
COPY --chmod=0555 worker/job-started.sh /usr/local/libexec/ci-runner-job-started.sh
COPY --chmod=0555 worker/job-completed.sh /usr/local/libexec/ci-runner-job-completed.sh
COPY --chmod=0555 worker/capture-cgroup.sh /usr/local/libexec/ci-runner-capture-cgroup
COPY --chmod=0555 worker/entrypoint.sh /usr/local/bin/ci-runner-entrypoint
# actions/setup-dotnet otherwise selects /usr/share/dotnet on Linux. Keep SDK,
# global-tool, and NuGet writes inside the disposable non-root runner home.
ENV DOTNET_INSTALL_DIR=/home/runner/.dotnet \
DOTNET_ROOT=/home/runner/.dotnet \
NUGET_PACKAGES=/home/runner/.nuget/packages \
PATH=/home/runner/.dotnet:/home/runner/.dotnet/tools:${PATH} \
ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1 \
ACTIONS_RUNNER_HOOK_JOB_STARTED=/usr/local/libexec/ci-runner-job-started.sh \
ACTIONS_RUNNER_HOOK_JOB_COMPLETED=/usr/local/libexec/ci-runner-job-completed.sh \
ImageOS=ubuntu24
# No base-image labels: Dependabot rewrites only the FROM line, and release
# provenance records the resolved base digest.
LABEL org.opencontainers.image.source="https://github.com/melodic-software/ci-runner" \
org.opencontainers.image.description="Ephemeral one-job GitHub Actions worker for ci-runner"
# The upstream user is uid/gid 1001 and has passwordless sudo, matching the
# official Actions runner container. The controller must not override this,
# mount host paths, attach devices, expose the Docker socket, or use privileged
# mode. It supplies the one-job JIT configuration only through the documented
# ACTIONS_RUNNER_INPUT_JITCONFIG environment variable.
USER runner
WORKDIR /home/runner
ENTRYPOINT ["/usr/local/bin/ci-runner-entrypoint"]
CMD ["/home/runner/run.sh"]