Skip to content

Instantly share code, notes, and snippets.

@frozenex
Last active September 29, 2019 02:35
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 frozenex/dd6216caac54312efef39c6a017a8fc9 to your computer and use it in GitHub Desktop.
Save frozenex/dd6216caac54312efef39c6a017a8fc9 to your computer and use it in GitHub Desktop.
Gitlab Runner Docker Container
#!/bin/bash
docker run -d \
--name gitlab-runner \
--restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:alpine
read -p "Enter gitlab runner registration-token: " TOKEN
docker exec -i gitlab-runner \
gitlab-runner register -n \
--non-interactive \
--url https://gitlab.com/ \
--registration-token $TOKEN \
--executor docker \
--description "Mobizerg Gitlab Runner" \
--tag-list "build,test,deploy" \
--run-untagged="false" \
--docker-image "docker:stable" \
--docker-privileged \
--docker-volumes "/certs/client"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment