Juni 9, 2022

GitLab Runner

Install runners

Download binary for x86-64

sudo curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64"

Change permission to execute

sudo chmod +x /usr/local/bin/gitlab-runner

Create GitLab CI user

sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

Install and start service

sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start

Registering runners

Obtaining a token

Register runner

  1. Run the following command: sudo gitlab-runner register
  2. Enter your GitLab instance URL (also known as the gitlab-ci coordinator URL).
  3. Enter the token you obtained to register the runner.
  4. Enter a description for the runner. You can change this value later in the GitLab user interface.
  5. Enter the tags associated with the runner, separated by commas. You can change this value later in the GitLab user interface.
  6. Enter any optional maintenance note for the runner.
  7. Provide the runner executor. For most use cases, enter docker.
  8. If you entered docker as your executor, you are asked for the default image to be used for projects that do not define one in .gitlab-ci.yml.