Docker image for running a Forgejo Actions runner with Docker socket access.
10K+
Docker image for running a Forgejo Actions runner with Docker socket access.
This image wraps the upstream forgejo-runner binary and generates a JSON configuration file at container startup. Configuration can be customized through environment variables, including nested config overrides using config__... keys.
/dataservices:
runner:
image: davbfr/forgejo-runner:12
container_name: forgejo-runner
environment:
- FORGEJO_INSTANCE_URL=https://forgejo.example.com
- FORGEJO_RUNNER_REGISTRATION_TOKEN=your-registration-token
- FORGEJO_RUNNER_NAME=docker-runner-01
- config__runner__capacity=2
- config__runner__timeout=2h
volumes:
- ./data:/data
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
Start the runner:
docker compose up -d
FORGEJO_INSTANCE_URL: URL of your Forgejo instanceFORGEJO_RUNNER_REGISTRATION_TOKEN: runner registration token from ForgejoFORGEJO_RUNNER_NAME: name shown in the Forgejo UIMount /data to persist:
/data/config.json/data/.runnerWithout a persistent /data volume, the container will register as a new runner every time it starts.
Mount the host Docker socket:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
This is required for Docker-based Forgejo Actions jobs.
The container builds /data/config.json on startup, then applies any environment variables that start with config__ or CONFIG__.
Format:
config__<key0>__<key1>__<key2>=<value>
Example:
config__runner__capacity=2
config__cache__enabled=false
config__runner__labels=["ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"]
config__runner__envs__HTTP_PROXY=http://proxy.internal:3128
These become JSON updates like:
{
"runner": {
"capacity": 2,
"labels": [
"ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
],
"envs": {
"HTTP_PROXY": "http://proxy.internal:3128"
}
},
"cache": {
"enabled": false
}
}
Value parsing rules:
Examples:
true becomes a boolean2 becomes a number["a","b"] becomes an arrayhello stays a stringOn startup the container:
/data/config.jsonconfig__... overrides/data/.runner does not existforgejo-runner daemon/data/.runner is missing./data/.runner and start the container again.config__runner__labels=[...].services:
runner:
image: davbfr/forgejo-runner:12
environment:
- FORGEJO_INSTANCE_URL=https://forgejo.example.com
- FORGEJO_RUNNER_REGISTRATION_TOKEN=your-registration-token
- FORGEJO_RUNNER_NAME=docker-runner-01
- config__runner__labels=["ubuntu-24.04:docker://docker.gitea.com/runner-images:ubuntu-24.04","docker:docker://data.forgejo.org/oci/node:lts"]
volumes:
- ./data:/data
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
Content type
Image
Digest
sha256:47f4791b8…
Size
18.9 MB
Last updated
4 days ago
docker pull davbfr/forgejo-runner:13