Skip to content

Instantly share code, notes, and snippets.

@nietzscheson
Forked from barnybug/docker-compose.yml
Created August 10, 2018 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nietzscheson/cc70dfc9037c6d35b689920ff8afc915 to your computer and use it in GitHub Desktop.
Save nietzscheson/cc70dfc9037c6d35b689920ff8afc915 to your computer and use it in GitHub Desktop.
Docker compose for a Docker-in-docker gitlab runners setup
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
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.example.com/
- REGISTRATION_TOKEN=see_gitlab_admin_runner_setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment