Dockerfile RawHistoryFolder
1# SPDX-License-Identifier: MIT
2#
3# ermite-runner-ubuntu-24.04: the minimal CI-1 runner image. The same
4# filesystem is used as an OCI image (container isolation) and exported to an
5# ext4 base image (vm isolation) by scripts/build-image.sh. It holds the OS
6# only: the runner executable is attached by the host at start (never baked
7# in), so a runner upgrade does not need an image rebuild.
8FROM ubuntu:24.04
9
10ARG DEBIAN_FRONTEND=noninteractive
11
12RUN apt-get update \
13 && apt-get install -y --no-install-recommends \
14 bash build-essential ca-certificates curl e2fsprogs git gnupg iproute2 \
15 iptables jq kmod procps python-is-python3 python3 ruby sudo tzdata unzip xz-utils zip \
16 && rm -rf /var/lib/apt/lists/*
17
18# The command-line tools of GitHub's ubuntu-24.04 image that workflows call
19# directly (runner-images, images/ubuntu/toolsets/toolset-2404.json:
20# apt.vital_packages and apt.cmd_packages), minus the daemons and services
21# (haveged, pollinate, sphinxsearch, systemd-coredump). parallel pulls in
22# sysstat, whose collection units are masked: a job image runs no services.
23RUN apt-get update \
24 && apt-get install -y --no-install-recommends \
25 acl aria2 binutils bison brotli bzip2 coreutils file findutils flex ftp \
26 libnss3-tools lz4 m4 mediainfo netcat-openbsd net-tools p7zip-full parallel \
27 patchelf pigz rsync shellcheck sqlite3 openssh-client sshpass swig telnet \
28 time wget \
29 && rm -rf /var/lib/apt/lists/* \
30 && for u in sysstat.service sysstat-collect.timer sysstat-summary.timer; do ln -sf /dev/null /etc/systemd/system/$u; done
31
32# Docker Engine from Docker's apt repository (the job gets its own daemon).
33RUN install -m 0755 -d /etc/apt/keyrings \
34 && curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \
35 && chmod a+r /etc/apt/keyrings/docker.asc \
36 && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable" \
37 > /etc/apt/sources.list.d/docker.list \
38 && apt-get update \
39 && apt-get install -y --no-install-recommends \
40 docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
41 && rm -rf /var/lib/apt/lists/*
42
43# Node.js 22 and yarn 1 system-wide in /usr/local, like GitHub's image
44# (runner-images, install-nodejs.sh:11-24 and toolset-2404.json: node.default
45# 22, node_modules yarn). The tarball is checked against the SHA-256 published
46# in https://nodejs.org/dist/v22.23.3/SHASUMS256.txt. /usr/local/lib/node_modules
47# and /usr/local/bin are world-writable so that "npm install -g" works as the
48# runner user (runner-images issue 3727).
49ARG NODE_VERSION=22.23.3
50ARG NODE_SHA256_AMD64=df450af89261115ef9f9e3830c3eeb2cc9213b63c720b1af623cb5dcbe2e02de
51ARG NODE_SHA256_ARM64=a44aeb94849a299b22df10b9e622ec2f605c2183501bc40590705131de7c740f
52RUN arch=$(dpkg --print-architecture) \
53 && case "$arch" in \
54 amd64) node_arch=x64; node_sha=$NODE_SHA256_AMD64 ;; \
55 arm64) node_arch=arm64; node_sha=$NODE_SHA256_ARM64 ;; \
56 *) echo "unsupported architecture $arch" >&2; exit 1 ;; \
57 esac \
58 && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${node_arch}.tar.xz" -o /tmp/node.tar.xz \
59 && echo "${node_sha} /tmp/node.tar.xz" | sha256sum -c - \
60 && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 --no-same-owner \
61 --exclude='*/CHANGELOG.md' --exclude='*/LICENSE' --exclude='*/README.md' \
62 && rm /tmp/node.tar.xz \
63 && npm install -g yarn@1.22.22 \
64 && npm cache clean --force \
65 && chmod -R 777 /usr/local/lib/node_modules \
66 && chmod 777 /usr/local/bin
67
68# Like GitHub-hosted runners: user "runner" (uid 1001), passwordless sudo,
69# member of "docker", with the job layout directories.
70RUN useradd --create-home --uid 1001 --shell /bin/bash runner \
71 && usermod -aG docker runner \
72 && echo 'runner ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/runner \
73 && chmod 0440 /etc/sudoers.d/runner \
74 && mkdir -p /home/runner/work /opt/hostedtoolcache /opt/ermite \
75 && chown -R runner:runner /home/runner /opt/hostedtoolcache
76
77ENV RUNNER_TOOL_CACHE=/opt/hostedtoolcache \
78 LANG=C.UTF-8
79
80# The runner executable is bind-mounted (container) or provided by the init
81# disk (vm) here; its init subcommand starts the job's own Docker daemon.
82ENTRYPOINT ["/opt/ermite/ermite-runner", "init"]