From 7c71c94366ae77ca16665fb71ed1ee12d2e448fb Mon Sep 17 00:00:00 2001 From: vbrandl Date: Sat, 29 Apr 2023 03:05:00 +0800 Subject: [PATCH] Document persisting `/data` for docker container (#160) `/data` must be kept between container restarts. Co-authored-by: Valentin Brandl Reviewed-on: https://gitea.com/gitea/act_runner/pulls/160 Reviewed-by: Lunny Xiao Reviewed-by: techknowlogick Co-authored-by: vbrandl Co-committed-by: vbrandl --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e84b2a..0e1a263 100644 --- a/README.md +++ b/README.md @@ -91,5 +91,29 @@ You can specify the configuration file path with `-c`/`--config` argument. ### Run a docker container ```sh -docker run -e GITEA_INSTANCE_URL=http://192.168.8.18:3000 -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock --name my_runner gitea/act_runner:nightly +docker run -e GITEA_INSTANCE_URL=http://192.168.8.18:3000 -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/data --name my_runner gitea/act_runner:nightly +``` + +The `/data` directory inside the docker container contains the runner API keys after registration. +It must be persisted, otherwise the runner would try to register again, using the same, now defunct registration token. + +### Running in docker-compose + +```yml +... + gitea: + image: gitea/gitea + ... + + runner: + image: gitea/act_runner + restart: always + depends_on: + - gitea + volumes: + - ./data/act_runner:/data + - /var/run/docker.sock:/var/run/docker.sock + environment: + - GITEA_INSTANCE_URL= + - GITEA_RUNNER_REGISTRATION_TOKEN= ```