-
Notifications
You must be signed in to change notification settings - Fork 0
Setup GitLab SaaS Runner
Chris Caspanello edited this page May 21, 2020
·
2 revisions
- Start up a GitLab runner in docker by creating a
docker-compose.yml
file with the following:version: "3.7" services: gitlab-runner: image: gitlab/gitlab-runner:latest container_name: gitlab-runner volumes: - "./gitlab-runner/config:/etc/gitlab-runner" - "/var/run/docker.sock:/var/run/docker.sock"
- Start up the container by typing
docker-compose up
. It is ok if you see error logs in the runner console; we will configure the token in the next step. - In GitLab; navigate to Project -> Settings -> CI/CD -> Runners. Copy the runner token.
- Run this script replacing
<<RUNNER TOKEN>>
with the value you just copied#!/bin/bash docker exec -it gitlab-runner \ gitlab-runner register \ --non-interactive \ --registration-token <<RUNNER TOKEN>> \ --locked=false \ --description docker-stable \ --url https://gitlab.com \ --executor docker \ --docker-image openjdk:8 \ --docker-volumes "/var/run/docker.sock:/var/run/docker.sock"
- Refresh the GitLab Runner page; the runner should now be registered with a green status indicator.