I installed Docker because I wanted to use Docker executor for better isolation of environments.
Follow the official manual.
https://docs.gitlab.com/runner/install/linux-repository.html
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
export GITLAB_RUNNER_DISABLE_SKEL=true; sudo -E apt install gitlab-runner
Check.
$ sudo gitlab-runner status
Runtime platform arch=amd64 os=linux pid=3163 revision=2ebc4dc4 version=13.9.0
gitlab-runner: Service is running!
$ sudo gitlab-runner list
Runtime platform arch=amd64 os=linux pid=3172 revision=2ebc4dc4 version=13.9.0
Listing configured runners ConfigFile=/etc/gitlab-runner/config.toml
https://docs.gitlab.com/runner/register/
I registred the Runner as a shared.
Get a registration token
gitlab-runner register
.# gitlab-runner register
Runtime platform arch=amd64 os=linux pid=4429 revision=2ebc4dc4 version=13.9.0
Running in system-mode.
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://{{ your_GitLab_hostname }}
Enter the registration token:
{{ the_token_you_get }}
Enter a description for the runner:
[{{ your_GitLab_Runner_hostname }}]:
Enter tags for the runner (comma-separated):
docker,ansible
Registering runner... succeeded runner=********
Enter an executor: docker, docker-ssh, shell, ssh, virtualbox, docker+machine, docker-ssh+machine, kubernetes, custom, parallels:
docker
Enter the default Docker image (for example, ruby:2.6):
alpine:3.13
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
To register the Runner send a POST request to https://{{ your_GitLab_hostname }}/api/v4/runners
.
/etc/gitlab-runner/certs/{{ hostname }}.crt
.And, retry the registration.
gitlab-runner stop
gitlab-runner uninstall
gitlab-runner install --user=atlex00 --working-directory=/home/atlex00
gitlab-runner start
--config /etc/gitlab-runner/config.toml
gitlab-runner
(as default), or working-directory option
in config file. Check also ps aux | grep gitlab
.