Setup a GitLab Runner

First, get the "Registration Token" from your instance: https://${GITLAB_URL}/admin/runners.

Then run the registration:

docker run --rm -it -v "${CONFIG_DIR}:/etc/gitlab-runner" gitlab/gitlab-runner register

Then run the container:

docker run --rm -d --name gitlab-runner -v "${CONFIG_DIR}:/etc/gitlab-runner" -v "/var/run/docker.sock:/var/run/docker.sock" gitlab/gitlab-runner

You will likely need to alter the runner's configuration within the GitLab interface.

To get started, do the following:

  • Check "Run untagged jobs"
  • Uncheck "Lock to current projects"


The config will look something like this. Multiple [[runners]] sections are allowed.

concurrent = 1
check_interval = 0

  session_timeout = 1800

  name = "${RUNNER_NAME}"
  url = "https://${GITLAB_URL}"
  executor = "docker"
    tls_verify = false
    image = "alpine:latest"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0