You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Introduction

GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.

Prerequisities

  1. Your GitLab repository supports CI/CD
    1. You can turn the feature ON in Settings → General → Visibility, project features, permissionsCI/CD
  2. Server that supports docker (supported platforms)

Instructions

This section describes how to install and configure GitLab runner using docker on Fedora server 

  1. Deploy virtual server in Portal (skip this section if you already have a server)
    1. See article for instructions
  2. Install Docker engine on server – choose one of the following options
    1. Step by step (official instructions
      1.  Set up the repository

        $: sudo dnf -y install dnf-plugins-core
        $: sudo dnf config-manager  --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
      2. Install Docker Engine

        $: sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    2. Convenience script (official instructions) – recommended only for testing and development purposes

       curl -fsSL https://get.docker.com -o get-docker.sh
       sudo sh get-docker.sh
  3. Start docker container with latest version of gitlab runner (official instructions)

    $: docker run -d --name gitlab-runner --restart always \
      -v /srv/gitlab-runner/config:/etc/gitlab-runner \
      -v /var/run/docker.sock:/var/run/docker.sock \
      gitlab/gitlab-runner:latest
  4. Configure GitLab runner to connect to your repository
    1. In your GitLab repository, go to SettingsCI/CDRunners
    2. You will need URL and registration token from Set up a specific runner for a project section
    3. Call following on the server with running docker container

      docker exec -it gitlab-runner gitlab-runner register --docker-privileged
    4. You will be prompted to fill-in following parameters:
      1. URL from step 4.c.
      2. Token from step 4.c.
      3. Description
      4. Tags for the runner (can leave this blank for the moment).
      5. Specify docker executor
      6. Specify a default Docker image (e.g. alpine:latest)
  • No labels