docker安装gitlab-runner并注册

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

你可能感兴趣的:(docker安装gitlab-runner并注册)