...
Deploy virtual server in Portal
Info Skip this step if you already have a server.
If you need new server, you can deploy one via TDS portal - Orchestration - Servers#Howtodeploynewserver
- Install Docker engine on server – choose one of the following options
Option A - using "convenience script" from official instructions – recommended only for development and testing purposes
Code Block language bash curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo systemctl start docker
- Option B - specific approach for each relevant OS - basically setting up repository and installing Docker Engine - all supported OS instructions can be found at https://docs.docker.com/engine/install
CentOS - official instructions
Code Block 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
Code Block 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
Code Block 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)
Code Block language bash sudo usermod -aG docker $USER
Start docker container with latest version of gitlab runner (official instructions)
Code Block language bash 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
- Configure GitLab runner to connect to your repository
- Go to desired GitLab repository → Settings → CI/CD → Runners
- Go to "Set up a specific runner for a project" section
- Copy the "URL" and "registration token", you will need it in next steps
Execute following command on the server with running docker container
Code Block language bash docker exec -it gitlab-runner gitlab-runner register --docker-privileged
- You will be prompted to fill-in following parameters:
- URL from step 45.b.
- Token from step 45.b.
- Description
- Tags for the runner (can leave this blank for the moment).
- Specify docker executor
- Specify a default Docker image (e.g. alpine:latest)