Skip to content

Instantly share code, notes, and snippets.

@kelchm
Created February 24, 2017 20:08
Show Gist options
  • Save kelchm/59207261cba0d4f9b3796549cfa571cc to your computer and use it in GitHub Desktop.
Save kelchm/59207261cba0d4f9b3796549cfa571cc to your computer and use it in GitHub Desktop.
Self-Registration of GitLab Runners within Rancher
version: '2'
services:
gitlab-runner-config:
image: gitlab/gitlab-runner:alpine
stdin_open: true
volumes:
- /etc/gitlab-runner/
tty: true
command:
- register
- -n
- --url
- <GITLAB URL>
- --registration-token
- <REGISTRATION TOKEN>
- --executor
- docker
- --description
- Rancher Docker Runner
- --docker-image
- docker:latest
- --docker-volumes
- /var/run/docker.sock:/var/run/docker.sock
labels:
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
gitlab-runner:
image: gitlab/gitlab-runner:alpine
stdin_open: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
tty: true
volumes_from:
- gitlab-runner-config
command:
- run
labels:
io.rancher.sidekicks: gitlab-runner-config
io.rancher.container.pull_image: always
io.rancher.scheduler.global: 'true'
version: '2'
services:
gitlab-runner-config:
scale: 1
start_on_create: true
gitlab-runner:
start_on_create: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment