6ca26d2309292b087b4b82354f7803dbd68d2080
Stable docker-compose setup for building Rust projects on Gitea Actions. DinD-isolated daemon, built-in cache server, capacity=4 parallel jobs, healthcheck-gated startup. Portable to other build machines via .env. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HU4wDwdydNZpR3YkMiYYy8
Gitea Act Runner (DinD + cache)
Stable Gitea Actions runner for building Rust projects. Runs jobs in an isolated Docker-in-Docker daemon with the built-in cache server enabled and multiple parallel jobs.
Setup on a new build machine
Requires Docker + Docker Compose.
cp .env.example .env
# edit .env: set GITEA_RUNNER_NAME (unique per machine) and a fresh
# GITEA_RUNNER_REGISTRATION_TOKEN from Gitea -> Actions -> Runners -> Create Runner
docker compose up -d
Verify:
docker compose ps # both containers up, dind healthy
docker logs gitea-runner-wsl 2>&1 | tail # "declare successfully"
Config
- Parallel jobs:
config.yaml->runner.capacity(default 4) - Job images:
config.yaml->runner.labels(ubuntu-latest/22.04/24.04) - Cache: enabled in
config.yaml; layer cache persists in thedind-storagevolume
Rust workflows
Copy example-rust-workflow.yaml to your repo at .gitea/workflows/build.yaml.
It uses actions-rust-lang/setup-rust-toolchain which caches ~/.cargo and
target/ via the runner's cache server.
Manage
docker compose up -d # apply config changes
docker compose down # stop (registration persists in volume)
docker compose pull # update runner/dind images
Each machine needs a unique
GITEA_RUNNER_NAMEand its own registration token. Rundocker compose down -vto fully reset (drops registration + caches).
Languages
Shell
100%