Skip to content

Instantly share code, notes, and snippets.

@chgsantos
Created September 30, 2020 21:32
Show Gist options
  • Save chgsantos/8ab25972536284e80c19a7061bc6c3ed to your computer and use it in GitHub Desktop.
Save chgsantos/8ab25972536284e80c19a7061bc6c3ed to your computer and use it in GitHub Desktop.
Gitlab Runner - docker-compose v2
version: '2'
services:
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2
runner:
restart: always
image: gitlab/gitlab-runner:alpine
volumes:
- gitlab_runner:/etc/gitlab-runner:Z
environment:
- DOCKER_HOST=tcp://dind:2375
register-runner:
restart: 'no'
image: gitlab/gitlab-runner:alpine
volumes:
- gitlab_runner:/etc/gitlab-runner:Z
command:
- register
- --non-interactive
- --locked=false
- --name=Docker Runner
- --executor=docker
- --docker-image=docker:17.09.0-ce-dind
- --docker-volumes=/var/run/docker.sock:/var/run/docker.sock
environment:
- CI_SERVER_URL=https://gitlab.com/
- REGISTRATION_TOKEN=[[GITLAB-TOKEN]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment