1
1
Fork
You've already forked forgejo-runner
0
Forgejo-runner image and setup capable of multiarch builds using DIND on k8s https://git.oranki.net/jarno/forgejo-runner
  • Go 83.5%
  • JavaScript 14.4%
  • Shell 1.5%
  • Makefile 0.4%
  • Dockerfile 0.1%
Find a file
2025年10月18日 00:20:24 +03:00
.forgejo Extract image version from tag, run only on pushed tag 2025年10月17日 22:49:06 +03:00
act fix: improve logging to diagnose mystery job terminations ( #1048 ) 2025年10月02日 22:43:50 +00:00
contrib Restore contrib/forgejo-runner.service ( #772 ) 2025年07月30日 22:16:05 +00:00
examples chore: upgrade LXC example to Debian GNU/Linux trixie ( #1020 ) 2025年09月20日 20:57:17 +00:00
internal fix(security): a multiline secret may be found in a single log entry ( #1051 ) 2025年10月03日 08:22:06 +00:00
release-notes feat: add the runner validate subcommand ( #757 ) 2025年07月31日 05:37:12 +00:00
scripts Enable ipv6 for the runner containers 2025年10月17日 22:49:06 +03:00
testutils feat: add the runner validate subcommand ( #757 ) 2025年07月31日 05:37:12 +00:00
.dockerignore [FORGEJO] build forgejo-runner 2023年08月23日 14:44:47 +02:00
.editorconfig Add .editorconfig and .gitattributes ( #186 ) 2023年05月13日 23:51:22 +08:00
.gitattributes Add .editorconfig and .gitattributes ( #186 ) 2023年05月13日 23:51:22 +08:00
.gitignore chore: remove unused code and comments including gitea 2025年07月03日 18:58:11 +02:00
.golangci.yml chore: use t.Context for tests, activate usetesting for lint + add t.TempDir and t.Chdir ( #844 ) 2025年08月11日 13:21:42 +00:00
.pre-commit-hooks.yaml fix(pre-commit): don’t default verbose to on ( #1015 ) 2025年09月18日 12:02:07 +00:00
Dockerfile Revert "Try to work around Alpine DNS bug" 2025年10月17日 22:49:06 +03:00
go.mod Revert "Update module connectrpc.com/connect to v1.19.0 ( #1029 )" 2025年09月27日 07:55:28 +02:00
go.sum Revert "Update module connectrpc.com/connect to v1.19.0 ( #1029 )" 2025年09月27日 07:55:28 +02:00
LICENSE chore: change the license to GPLv3-or-later ( #773 ) 2025年09月04日 09:26:12 +00:00
main.go chore: bump version to v11 ( #940 ) 2025年09月05日 07:29:38 +00:00
Makefile Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.5.0 ( #1023 ) 2025年09月22日 10:10:07 +00:00
README.md Add link to example workflow 2025年10月18日 00:20:24 +03:00
RELEASE-NOTES.md chore: release notes are now published together with the release ( #775 ) 2025年07月31日 08:02:20 +00:00
renovate.json chore(renovate): group runner updates 2025年09月10日 09:51:22 +02:00

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 Deployment from Upstream documentation

  • Generate runner token in Forgejo Admin settings, and place it in quotes in the token field in the Secret in 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-register initContainer, replace command: 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 command completely from the runner container, unless you wish to customize it

    The default CMD for the image is /run-k8s-dind.sh, which is found under /scripts in 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 localhost here refers to the localhost in the DinD container. docker means to run on "host" (which is in a container) according to the runner's --label flag.

    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.

Upstream Forgejo Runner documentation

https://code.forgejo.org/forgejo/runner