Skip to content

Instantly share code, notes, and snippets.

@xetys
Created September 25, 2016 12:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xetys/cc31216d2337f5d3d07b4b3422b88b79 to your computer and use it in GitHub Desktop.
Save xetys/cc31216d2337f5d3d07b4b3422b88b79 to your computer and use it in GitHub Desktop.
a script to starting GitLab CI runners, which can run docker inside
#!/bin/sh
docker run -d --name "gitlab-runner-$1" --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest
docker exec -it "gitlab-runner-$1" gitlab-runner register -n \
--url "$3/ci" \
--registration-token "$2" \
--executor docker \
--description "ci-runner-$1" \
--docker-image "docker:latest" \
--docker-volumes /var/run/docker.sock:/var/run/docker.sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment