Using docker compose run commands to register a runner makes changing the docker-compose.yml before and after registration unnecessary.
Issue #1377 - Installation of forgejo-runner via docker - which docs should one use?
CSDUMMI/docs:next into next
Using docker compose run commands to register a runner makes changing the docker-compose.yml before and after registration unnecessary.
Issue #1377 - Installation of forgejo-runner via docker - which docs should one use?
Using `docker compose run` commands to register a runner makes changing the docker-compose.yml before and after registration unnecessary. Issue #1377 - Installation of forgejo-runner via docker - which docs should one use?
@ -401,3 +390,1 @@
chmod 775 data/.cache
chmod g+s data/.runner
chmod g+s data/.cache
mkdir data
# mkdir data
# chown -R 1001:1001 data/
@ -404,3 +392,3 @@
```
After running this script with `bash setup.sh`, define the following `docker-compose.yml`:
After creating the data directory, define the following `docker-compose.yml`:
# cat > docker-compose.yml
services:
docker-in-docker:
image: docker:28-dind
hostname: docker
privileged: true
environment:
DOCKER_TLS_CERTDIR: /certs
DOCKER_HOST: docker-in-docker
volumes:
- ./certs:/certs
runner:
image: code.forgejo.org/forgejo/runner:9.0.3
environment:
DOCKER_HOST: tcp://docker:2376
DOCKER_CERT_PATH: /certs/client
DOCKER_TLS_VERIFY: "1"
depends_on:
docker-in-docker:
condition: service_started
volumes:
- ./data:/data
- ./certs:/certs
user: 1001:1001
command: forgejo-runner daemon
@ -436,3 +422,3 @@
```
Here, we're not running the `forgejo-runner daemon` yet because we need to register it first. Please note that in a recent install of docker `docker-compose` is not a separate command but should be run as `docker compose`.
To execute the `forgejo-runner` command in the `runner` container, you have to run `docker compose run -u 1001 --rm -it runner forgejo-runner`. Use this command now to [register](#standard-registration) your runner.
# forgejo-runner-9.0.3 register --no-interactive --instance https://v13.next.forgejo.org --name runner --token $REGISTRATION_TOKEN
INFO Registering runner, arch=amd64, os=linux, version=v9.0.3.
DEBU Successfully pinged the Forgejo instance server
INFO Runner registered successfully.
@ -450,3 +426,1 @@
```
Here, the sleep allows the `docker-in-docker` service to start up before the `forgejo-runner daemon` is started.
After registering your runner, you can start the runner with `docker compose up -d` and verify that the runner is connected to `forgejo` by going to `<your forgejo instance>/admin/actions/runners` and seeing whether your runner is marked as idle.
This is where troubleshooting instructions would be needed. I'm quite sure that if you do exactly what I did you'll get exactly the same failure.
I was able to reproduce this behavior and fix it by creating the certs folder together with data. I'll add that to the instructions.
@CSDUMMI can you please archive / document the output of your actions to repeat the instructions in the same way I did? Provided that I will repeat the process from scratch myself.
Archived
Archived
Archived
Archived
Archived
Archived
Archived
Archived
Archived
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?