|
| 1 | +# Custom Forgejo Runner Image |
| 2 | + |
| 3 | +Docker image for Forgejo Actions runners, based on `debian:bookworm` with tools pre-installed to avoid repeated `apt-get install` in every job. |
| 4 | + |
| 5 | +## What's included |
| 6 | + |
| 7 | +| Category | Packages | |
| 8 | +|----------|----------| |
| 9 | +| **Runtime** | Node.js 24 (via NodeSource) | |
| 10 | +| **VCS** | git, git-lfs, openssh-client | |
| 11 | +| **Build tools** | build-essential, pkg-config, libssl-dev, libudev-dev | |
| 12 | +| **Container builds** | buildah (pre-configured with vfs storage driver), fuse-overlayfs | |
| 13 | +| **Utilities** | curl, wget, jq, tar, gzip, xz-utils, unzip, zip, sudo, ca-certificates | |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +Pull the image from GitHub Container Registry: |
| 18 | + |
| 19 | +``` |
| 20 | +ghcr.io/systemscape/custom-forgejo-runner:latest |
| 21 | +``` |
| 22 | + |
| 23 | +Or build locally: |
| 24 | + |
| 25 | +```sh |
| 26 | +just build |
| 27 | +``` |
| 28 | + |
| 29 | +## Runner configuration |
| 30 | + |
| 31 | +In your Forgejo runner config, set labels to map workflow `runs-on` values to this image: |
| 32 | + |
| 33 | +```yaml |
| 34 | +labels: |
| 35 | + - "docker:docker://ghcr.io/systemscape/custom-forgejo-runner:latest" |
| 36 | + - "debian-latest:docker://ghcr.io/systemscape/custom-forgejo-runner:latest" |
| 37 | + - "ubuntu-latest:docker://ghcr.io/systemscape/custom-forgejo-runner:latest" |
| 38 | +``` |
| 39 | +
|
| 40 | +If you build locally instead, replace the image reference with `docker://localhost/forgejo-runner`. |
| 41 | + |
| 42 | +Each label follows the format `<name>:docker://<image>`. When a workflow specifies `runs-on: ubuntu-latest`, the runner picks the matching label and starts a container from the configured image. |
| 43 | + |
| 44 | +## Extending |
| 45 | + |
| 46 | +Add packages to the `Dockerfile` and rebuild. For tools that are only needed by a single workflow, consider installing them in the workflow step instead to keep the base image lean. |
| 47 | + |
| 48 | +### Rust toolchain |
| 49 | + |
| 50 | +Rust is **not** pre-installed since [`dtolnay/rust-toolchain`](https://github.com/dtolnay/rust-toolchain) handles version pinning per-repo. The build toolchain (`build-essential`, `libssl-dev`, etc.) is included so Rust compilation works out of the box once the toolchain is installed. |
| 51 | + |
| 52 | +### Buildah |
| 53 | + |
| 54 | +Buildah is pre-installed and configured with the `vfs` storage driver (overlay-on-overlay is not supported inside containers). Workflows no longer need the `apt-get install buildah` + storage config boilerplate. |
0 commit comments