- Dockerfile 80.5%
- JavaScript 19.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Image builds live in their own repo, not in infra. omnictl is for the Omni cluster-template CI; it must match the self-hosted Omni API, so rebuild after Omni upgrades. No baked provider cache (that was infra-specific); providers download on init, or cache them with actions/cache. |
||
| .forgejo/workflows | ||
| android-node | ||
| node-docker | ||
| node-go | ||
| node-go-docker | ||
| node-python | ||
| scripts | ||
| tofu | ||
| README.md | ||
ci-images
Prebaked CI base images for the actions org. Published to
git.bun.cafe/actions/<image>.
These exist to delete a preamble that every image-building repo was repeating on every single run:
# before — ~30s and 65.9 MB of apt per run, per repo
- run: apt-get update && apt-get install -y docker.io
- run: |
cid=$(docker create docker/buildx-bin:0.36.0 /buildx)
docker cp "$cid:/buildx" /usr/local/lib/docker/cli-plugins/docker-buildx
docker rm "$cid"
# after
container:
image: git.bun.cafe/actions/node-docker:24
Debian's docker.io is the whole engine — containerd, runc and iptables a
client-only job never touches — and it ships CLI 20.10 with no buildx plugin.
These images use Docker's own apt repo instead, so the CLI is current and buildx
is a first-class package.
Images
| image | tag | base | contents |
|---|---|---|---|
node-docker |
24 |
node:24-bookworm |
node 24, npm, git, docker-ce-cli, docker-buildx-plugin, docker-compose-plugin |
tofu |
1.13 |
node:24-bookworm |
node 24, npm, git, tofu 1.13.1, omnictl, curl, jq, zstd |
node-python |
24 |
node:24-bookworm |
node 24, npm, git, python3, python3-yaml, jq |
android-node |
35 |
ghcr.io/cirruslabs/android-sdk:35 |
JDK 21 + JDK 17 (the app's toolchain), SDK platform 35, build-tools 35 + 34 (AGP's default), NDK r27.3 only (the pin), node 24, npm, git, cmake, clang/libclang-dev, fakeroot, rustup stable + Android targets — amd64 only |
Each image publishes a moving tag that consumers pin (24 for node-docker,
1.12 for tofu — the tag tracks whatever version is the point of the image),
plus an immutable <tag>-<short-sha> to roll back to. The node-based images are
multi-arch (linux/amd64,linux/arm64), so they work on an arm64 runner if we
add one; android-node is amd64 only, because its base is.
Usage
node-docker is for jobs that run node-based actions — actions/checkout needs
node in the job container — and also drive the host dockerd:
jobs:
build:
runs-on: self-hosted
container:
image: git.bun.cafe/actions/node-docker:24
env:
DOCKER_HOST: tcp://172.17.0.1:2375
steps:
- uses: actions/checkout@v4
- run: docker buildx version # already there
tofu is for jobs that run tofu alongside node-based actions, replacing a
setup-opentofu step per job — which in cornerstone-gitops means three, since
plan runs a matrix over the network, identity and cluster layers:
jobs:
plan:
runs-on: self-hosted
container:
image: git.bun.cafe/actions/tofu:1.13
steps:
- uses: actions/checkout@v4
- run: tofu version # already there
curl and jq are included because the tofu workflows need them at job time, not build time: the Forgejo→Entra OIDC exchange pipes curl into jq, and tofu-apply's auto-paste builds its Contents API payload with jq.
zstd is here for actions/cache, which prefers it and falls back to gzip in
silence when it is missing. Easy to overlook and expensive in this case: the tofu
provider cache is ~478 MB per layer, archived and restored every run.
The image only removes the CLI download, which is the smaller half. Providers are
the larger cost — the identity layer pulls five, including azurerm and cloudflare
— and they are cached separately, by TF_PLUGIN_CACHE_DIR plus actions/cache
in the consuming workflow. Not baked in here: baked providers would drift against
each layer's .terraform.lock.hcl.
node-python is for the manifest policy checks (scripts/check_*.py). PyYAML comes
from apt rather than pip because the runner's system Python is externally managed
(PEP 668) and refuses pip installs — and a job without a container runs
unprivileged on the host, where apt-get update fails outright with
List directory /var/lib/apt/lists/partial is missing. Baking it removes that
whole class of problem:
jobs:
check:
runs-on: self-hosted
container:
image: git.bun.cafe/actions/node-python:24
credentials:
username: ${{ github.actor }}
password: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- run: scripts/check-image-pins.sh .
Pin the moving tag, not latest — there is no latest. If a rebuild ever breaks
you, pin the <tag>-<short-sha> from the previous run while it gets fixed.
Adding an image
Add a directory. That's it — nothing central to edit.
my-image/
├── Dockerfile
└── image.json
{
"version": "1",
"platforms": "linux/amd64,linux/arm64",
"description": "what this image is for"
}
| field | required | notes |
|---|---|---|
version |
yes | the moving major tag consumers pin, e.g. 24 |
platforms |
no | defaults to linux/amd64,linux/arm64 |
description |
no | shown in the discovery log |
Open a PR: it builds every architecture and discards the result, so a broken
Dockerfile cannot reach a consumer. Merging to main publishes.
End each Dockerfile with a smoke test (RUN docker buildx version and friends).
It costs nothing and means a broken image fails in CI instead of in every repo
that consumes it.
How discovery works
scripts/discover-images.mjs finds every top-level directory holding a
Dockerfile plus an image.json, works out which ones a change touched, and emits
a JSON list that the build job expands into a matrix via fromJSON. One job per
changed image, none for the rest.
It is a plain node script with no dependencies, so you can run it yourself:
CHANGED_FILES="node-docker/Dockerfile" node scripts/discover-images.mjs
FORCE_IMAGES=all node scripts/discover-images.mjs
The script is deliberately loud. A dynamic matrix's one real failure mode is a run that quietly expands to zero jobs and reads as success, so every path to an empty list is either an explicit "nothing changed" (with the build job showing a visible skip) or a hard error:
- a directory with a
Dockerfilebut noimage.json→ error - malformed
image.json, or one missingversion→ error - no image directories at all → error
- an unknown name passed to
FORCE_IMAGES→ error - no usable diff (new branch, force-push, shallow clone) → build everything
- a change to the workflow or to the discovery script itself → build everything
Runner requirements
Building these images needs a runner visible to the actions org — a runner
registered only under CornerstoneEngineering cannot pick these jobs up, and the
run sits queued indefinitely rather than failing.
| requirement | why |
|---|---|
label self-hosted |
what the workflow requests |
| job containers can reach a dockerd | the build talks to it over DOCKER_HOST |
| that dockerd permits privileged containers | QEMU binfmt registration, and the docker-container buildx driver runs buildkitd privileged |
egress to deb.debian.org, download.docker.com, docker.io |
the bootstrap install and base image pulls |
DOCKER_HOST defaults to tcp://172.17.0.1:2375 (the docker0 bridge gateway,
matching how the existing runners are wired). Set a DOCKER_HOST org
variable to override it for a runner set up differently.
Secrets
| secret | why |
|---|---|
NPM_TOKEN |
pushing to the container registry — a token with package read/write |
Set as a repo secret on this repo, not org-wide: ci-images is the only thing
in the actions org that publishes packages, so there is no reason for the
credential to be visible to anything else. It belongs to the system service
account and is scoped to write:package,read:package only.
Service accounts here authenticate via OIDC and have no password, so the token cannot be minted through the API. Mint it from the Forgejo host:
sudo docker exec -u git forgejo forgejo admin user generate-access-token \
--username system --token-name actions-packages \
--scopes write:package,read:package --raw
Not the automatic run token: the packages this repo publishes (actions/<image>)
are not named after the repo, and the run token's package scope does not cover
them. The push fails late, at the export stage, with
401 Unauthorized: reqPackageAccess — after both architectures have already
built. NPM_TOKEN is also what every other repo in the org logs in with.
Prefer an org-scoped runner over an instance-global one. A runner with dockerd
access is root-equivalent on its host, and if two runners both advertise
self-hosted then scheduling is nondeterministic — which matters here because
the persistent buildkit container holding the layer cache lives on exactly one
host.
Why this repo does not use its own images
It would be circular, and a bad publish would lock us out of fixing it. So
build-images.yml pays the bootstrap cost these images remove — Debian's
docker.io plus buildx extracted from docker/buildx-bin. One repo pays it so
that consumers don't.