2.3 KiB
Gitea actions in rootless docker containers
This package configures a rootless docker instance owned by the docker-rootless user
to enable gitea actions in a non-root docker environment.
Post-installation steps
You have to start and register the docker instance with Gitea:
systemctl -M gitea-runner-rootless@ --user enable --now dockerd-rootless-user
/usr/share/gitea-runner/register-rootless.sh
systemctl -M gitea-runner-rootless@ --user enable --now gitea-runner-rootless
You will be asked to input:
- Gitea instance URL, like
http://192.168.8.8:3000/. You should use your gitea instance ROOT_URL as the instance argument and you should not uselocalhostor127.0.0.1as instance IP; - Runner token, you can get it from
http://192.168.8.8:3000/admin/actions/runners; - Runner name, you can just leave it blank;
- Runner labels, you can just leave it blank.
Apart from registering the docker instance, the script also produces a default config file in the /home/gitea-runner-rootless/runner directory.
Configuration
The runner can be configured with a configuration file.
The systemd user service file expects the file to be /home/gitea-runner/runner/config.yaml.
The registration script generates a default config file with the envs: and labels: values removed in the above-mentioned directory.
NB: The value of
labels:in the config file, if they are specified, override any labels configured during registration on the next startup.
The log level is set to debug, to assist first setup and should be changed to info during normal operation.
The configuration file is a YAML file, which can also generated as a sample configuration file with gitea-runner generate-config.
cd ~gitea-runner-rootless/runner
gitea-runner generate-config > config.yaml
chown gitea-runner-rootless:gitea-runner-rootless config.yaml
chmod 0640 config.yaml
NB: The generated config file has the default values of
labels:, which override any labels configured during registration on the next startup. There are also some defaultenvs:values, that result in environment variables in all runs.
Uninstallation
If you uninstall the package, you need to manually remove the registration in the Gitea UI and remove the /home/gitea-runner-rootless directory, if required.