GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.
This section describes how to install and configure GitLab runner using docker on some server.
Deploy virtual server in Portal
Skip this step if you already have a server. If you need new server, you can deploy one via TDS portal - Orchestration - Servers#Howtodeploynewserver |
Option A - using "convenience script" from official instructions – recommended only for development and testing purposes
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo systemctl start docker |
CentOS - official instructions
sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y |
Fedora - official instructions
sudo dnf -y install dnf-plugins-core sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y |
Ubuntu - official instructions
sudo apt-get update sudo apt-get install ca-certificates curl gnupg lsb-release -y sudo mkdir -m 0755 -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
Add your user to docker group to be able to run docker commands (more about security in article)
sudo usermod -aG docker $USER |
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 |
Execute following command on the server with running docker container
docker exec -it gitlab-runner gitlab-runner register --docker-privileged |