1.本人使用的是gitlab官网,并没搭建。
2.创建GitLab Runner
docker pull gitlab/gitlab-runner:latest
3.启动
docker run -d --name gitlab-runner --restart always --privileged -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest
4.注册
运行register命令:
docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
输入您的GitLab实例URL:
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
输入您获得的令牌来注册亚军:
Please enter the gitlab-ci token for this runner
xxx输入Runner的描述,稍后可以在GitLab的UI中进行更改:
Please enter the gitlab-ci description for this runner
[hostname] my-runner输入与Runner关联的标签,稍后可以在GitLab的UI中进行更改: