1、安裝gialb-runner
--name gitlab-runner \
--restart always \
-v /data/gitlab-runner/config:/etc/gitlab-runner \
-v /dat/gitlab-runner/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
2、使用docker容器注冊gitlab-runner
(1)docker exec -it gitlab-runner gitlab-ci-multi-runner register
輸入您的GitLab實例URL:
(2)Please enter the gitlab-ci token for this runner
輸入 令牌
(3)Please enter the gitlab-ci description for this runner
[hostname] 輸入Runner的描述,您可以稍后在GitLab的UI中更改
(4)Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag 輸入與Runner關聯的標簽,您可以稍后在GitLab的UI中更改
(5)Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
docker 輸入runner執行程序
#如果您選擇Docker作為執行程序,則會要求您將默認圖像用于未在其中定義的項目.gitlab-ci.yml:
(6)Please enter the Docker image (eg. ruby:2.1):
alpine:latest