Last active
November 24, 2020 02:34
-
-
Save neilkuan/d30c2a66162f9b0b1c666c15d51813c7 to your computer and use it in GitHub Desktop.
Example Register Docker Runner Shell Script .
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RUNNER_TOKEN=$1 | |
# Register | |
docker run -it --rm -v /root/gitlab-runner-sit:/etc/gitlab-runner gitlab/gitlab-runner:alpine \ | |
register --non-interactive --url https://gitlab.com \ | |
--registration-token ${RUNNER_TOKEN} --docker-pull-policy if-not-present \ | |
--docker-volumes /var/run/docker.sock:/var/run/docker.sock --executor docker \ | |
--docker-volumes /root/.m2:/root/.m2 \ | |
--docker-image alpine:latest --description "Docker Runner" --docker-privileged \ | |
--tag-list "sit,build,sc" --tls-ca-file=/etc/gitlab-runner/certs/gitlab.com.crt | |
# Run | |
docker run -d --name sit-build-runner -v /root/gitlab-runner-sit:/etc/gitlab-runner \ | |
-v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:alpine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment