GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.
-
Before setting everything else, create a directory where the configuration files will reside. Ensure that the directory exists and appropriate permission have been granted.
$ mkdir -vp ~/docker/gitlab-runner
-
Modify the
.env
file, you can fine tune these configurations to meet your requirements.GITLAB_RUNNER_IMAGE=gitlab/gitlab-runner:v15.3.0 GITLAB_RUNNER_HOME=~/docker/gitlab-runner
-
Make sure you are in the same directory as docker-compose.yml and start GitLab Runner:
$ docker-compose up -d
-
The final step is to register a new runner. The GitLab Runner container doesn’t pick up any jobs until it’s registered
$ docker exec -it gitlab-runner gitlab-runner register
-
If something else goes wrong, for more detailed tutorial can be found on the GitLab Runner Website