Files
fristy a7f9769a82
build / build (26.04) (pull_request) Successful in 3m34s
build / build (26.10) (pull_request) Successful in 3m35s
build / build (24.04) (pull_request) Successful in 3m38s
fix: upgrade base packages and npm to clear the image scan
apt-get upgrade keeps buildpack-deps from freezing linux-libc-dev at the
version the base image shipped with; five CRITICAL kernel CVEs in that
package alone failed the 24.04 publish. npm 11.21.3 replaces the undici
6.28.0 and brace-expansion 5.0.9 bundled with node 26.13.1, 12 HIGH
findings. The npm tree is copied back into the tool cache because the
in-place upgrade breaks its hardlink.

Release pipeline: each main build now cuts the next patch from the newest
v* tag, publishes v<semver>-ubuntu-<base> next to the moving ubuntu-<base>
tags, and only tags the commit after every base has published, so a failed
scan can no longer leave a half published version. The v0.0.0-dev.<sha>
fallback is gone.

Docs: README no longer pins tool versions that Renovate already tracks, and
the image tags, versioning and commit conventions are written down.
2026-11-20 14:35:30 +03:00

110 lines
4.4 KiB
Markdown

# runner-images
Runner images for the Gitea Actions runners of our [fristea](https://git.fristy.net/fristy/fristea)
instance at `git.fristy.net`.
The current set is Ubuntu-based (24.04, 26.04, 26.10). The Dockerfiles are written
per base distribution, so a Debian or Alpine variant can be added later without
changing the workflow or tag layout.
## Why we build our own
The official Gitea runner images (`docker.gitea.com/runner-images`, built on
`buildpack-deps`) cover the generic case. Our workflows kept downloading the same
things on every single run:
| Workflow step | What it fetched | Where from |
|---|---|---|
| `actions/setup-node` | node 26.x | **GitHub API** |
| `actions/setup-python` | python 3.x | **GitHub API** |
| `pnpm/action-setup` | pnpm 12.x | npm registry |
| `dtolnay/rust-toolchain` | rustup + toolchain | static.rust-lang.org |
| release job | zig, cargo-zigbuild, nfpm | ziglang.org, GitHub |
| ci job | trivy (install.sh) | GitHub |
The two rows marked **GitHub API** share one anonymous quota of ~60 requests per
hour per IP. Several CI runs in the same hour exhausted it and jobs started dying
inside `Setup Node` before anything was compiled. Baking the tools into the image
removes the downloads entirely, so the quota no longer matters. The table names
the major line only; the exact pin lives in the Dockerfile (see
[Versions](#versions)).
Differences from `gitea/runner-images`:
- node 26 (the image tag we run) instead of node 24, plus pnpm and corepack
- go, rust with the `aarch64-unknown-linux-musl` target, cargo-zigbuild and zig
- gh, trivy and nfpm
- `ubuntu-26.04` and `ubuntu-26.10` next to `ubuntu-24.04`
- no slim or full flavour yet
## What is inside
| Tool | Notes |
|---|---|
| node 26.x | installed into `RUNNER_TOOL_CACHE` and hard linked into `/usr/local`, so `setup-node` never downloads it |
| npm, pnpm, corepack | global installs on top of node |
| python3 + pip + pipx | `yamllint` comes from pipx |
| docker CLI + buildx + compose plugin | jobs talk to the host daemon through the mounted socket |
| git + git-lfs, jq, yq, tea, shellcheck, sqlite3 | the usual suspects |
| go, rust (rustup), cargo-zigbuild, zig | cross builds for `aarch64-unknown-linux-musl` |
| gh, trivy, nfpm | release tooling |
## Versions
Each tool is pinned to an exact version in a `# renovate:`-annotated `ARG` in
[dockerfiles/ubuntu.dockerfile](dockerfiles/ubuntu.dockerfile). Renovate keeps
those pins current, so this README names only the major line and does not go
stale when a patch is released.
## Tags
| Tag | Meaning |
|---|---|
| `ubuntu-latest` | newest base (Ubuntu 26.10) |
| `ubuntu-26.10`, `ubuntu-26.04`, `ubuntu-24.04` | moving: newest build for that base |
| `v1.0.1-ubuntu-26.10` | immutable: one release, one base |
Every successful run on `main` — including the monthly rebuild — cuts the next
patch version from the newest `v*` tag, pushes `<version>-ubuntu-<base>` next to
the moving tags, and only then tags the commit with `<version>`. Nothing is
published under a version tag when a base fails its scan.
For a minor or major release, start the `release` workflow by hand with
`version` set (for example `v1.1.0`); the same run publishes and tags it.
Images are `linux/amd64` only for now. The Dockerfile already handles `arm64`
(`TARGETARCH`), it is just not in the build matrix.
The repository follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
dependency bumps are patch releases, new bases or tools are minor, and breaking
changes are major. Changes land in [CHANGELOG.md](CHANGELOG.md) following
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## Using an image
Map a label to the image in the runner config (`/config.yaml`):
```yaml
runner:
labels:
- "ubuntu-latest:docker://git.fristy.net/actions/runner-images:ubuntu-latest"
- "ubuntu-26.04:docker://git.fristy.net/actions/runner-images:ubuntu-26.04"
```
Then `runs-on: ubuntu-latest` picks it up. Workflows that used to call
`actions/setup-node` can drop it: node is already on `PATH`.
## Building locally
```bash
docker build -f dockerfiles/ubuntu.dockerfile \
--build-arg BASE_IMAGE_TAG=26.10 \
-t runner-images:ubuntu-26.10 .
docker run --rm -i runner-images:ubuntu-26.10 bash -s -- 26.10 < tests/default.sh
```
`build.yaml` does exactly this for every tag in the matrix on pull requests;
`release.yaml` publishes to `git.fristy.net/actions/runner-images` on `main`,
monthly, or on demand.