Skip to content

Instantly share code, notes, and snippets.

@p0vidl0
Last active August 15, 2018 02:34
Show Gist options
  • Save p0vidl0/1acdbd7da534841063d319375df2e879 to your computer and use it in GitHub Desktop.
Save p0vidl0/1acdbd7da534841063d319375df2e879 to your computer and use it in GitHub Desktop.
# Run gitlab runner inside docker container
docker run -d --name gitlab-runner --restart always --privileged \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:v10.3.0
# Register shell runner
sudo gitlab-runner register \
-non-interactive \
--executor "shell" \
--url $GITLAB_URI \
--registration-token $GITLAB_TOKEN \
--description "Shell runner" \
--run-untagged \
--locked="false" \
--tag-list docker
# Register docker runner
sudo gitlab-runner register -n \
--url $GITLAB_URI \
--registration-token $GITLAB_TOKEN \
--executor docker \
--description "Priveleged Docker runner" \
--docker-image "docker:stable" \
--docker-privileged \
--tag-list docker \
--locked="false"
# Allow runner to use host docker
usermod -a -G docker gitlab-runner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment