Skip to content

Instantly share code, notes, and snippets.

@AlperRehaYAZGAN
Last active June 21, 2022 14:20
Show Gist options
  • Save AlperRehaYAZGAN/f0539ba09fc395b77684c0930f55c708 to your computer and use it in GitHub Desktop.
Save AlperRehaYAZGAN/f0539ba09fc395b77684c0930f55c708 to your computer and use it in GitHub Desktop.
This is the Gitlab CI Docker Runner Exmaple Node Docker Compose Yaml File. (Originally cloned from https://forum.gitlab.com/t/example-gitlab-runner-docker-compose-configuration/67344)
# docker volume create gitlab-runner-config
version: "3.5"
services:
dind:
image: docker:20-dind
restart: always
privileged: true
environment:
DOCKER_TLS_CERTDIR: ""
command:
- --storage-driver=overlay2
runner:
restart: always
image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
depends_on:
- dind
environment:
- DOCKER_HOST=tcp://dind:2375
volumes:
- ./certs/:/mycerts/
- gitlab-runner-config:/etc/gitlab-runner
register-runner:
restart: 'no'
image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
depends_on:
- dind
environment:
- CI_SERVER_URL=${CI_SERVER_URL}
- REGISTRATION_TOKEN=${REGISTRATION_TOKEN}
- DOCKER_HOST=tcp://dind:2375
command:
- register
- --non-interactive
- --locked=false
- --name=${RUNNER_NAME}
- --executor=docker
- --docker-image=docker:20-dind
- --docker-volumes=/var/run/docker.sock:/var/run/docker.sock
- --tls-ca-file=/mycerts/cert.cer
volumes:
- ./certs/:/mycerts/
- gitlab-runner-config:/etc/gitlab-runner
volumes:
gitlab-runner-config:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment