- Go 83.5%
- JavaScript 14.4%
- Shell 1.5%
- Makefile 0.4%
- Dockerfile 0.1%
oranki/forgejo-runner
This is a slightly modified version of upstream Forgejo runner.
The modifications allow to run multiarch builds on k8s using docker/setup-qemu-action@v3.
All the modifications are to the Dockerfile.
Prebuilt images available at codeberg.org
Usage:
Adapted from this comment
-
Download/copy example
Deploymentfrom Upstream documentation -
Generate runner token in Forgejo Admin settings, and place it in quotes in the
tokenfield in theSecretin top of the above definition -
replace
code.forgejo.org/forgejo/runner:<version>with this image:codeberg.org/oranki/forgejo-runner:<version>.- No guarantees about keeping up with upstream, see Build your own below.
-
For the
runner-registerinitContainer, replacecommand:with the following:... command: - "forgejo-runner" - "register" - "--no-interactive" - "--token" - $(RUNNER_SECRET) - "--name" - $(RUNNER_NAME) - "--instance" - $(FORGEJO_INSTANCE_URL) - "--labels" - "docker:host" env: - name: RUNNER_NAME valueFrom: fieldRef: fieldPath: metadata.name ... -
Remove
commandcompletely from therunnercontainer, unless you wish to customize itThe default CMD for the image is
/run-k8s-dind.sh, which is found under/scriptsin this repo. -
kubectl apply -f, and you should have a runner cabaple of multiarch builds! -
In the Forgejo Action YAML, use
jobs: build: runs-on: docker env: DOCKER_HOST: "tcp://localhost:2376"The
localhosthere refers to the localhost in the DinD container.dockermeans to run on "host" (which is in a container) according to the runner's--labelflag.Example workflow: https://git.oranki.net/jarno/nextcloud-previews/src/branch/master/.forgejo/workflows/current-fpm.yaml
Build your own
Clone the repo and run
podman build -t example.com/forgejo-runner:latest .
Replace the value for the -t flag with what you like. Then use that as the image ref.