使用Docke注册Runner

获取你的token
请添加图片描述

## 启动docker
docker run -d --name gitlab-runner \
   --restart always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /srv/gitlab-runner/config:/etc/gitlab-runner \
     gitlab/gitlab-runner:alpine-v16.2.3

进入容器


# docker exec -it gitlab-runner bash
# gitlab-runner register

http://gitlab.neway.com
Enter the registration token:
NJrUkircTGxTzPtQfZUz  -------------

Enter a description for the runner:
[2af202bf1943]: uat-config -------------

Enter tags for the runner (comma-separated):
uat,prod ---------------

Enter optional maintenance note for the runner:
uat-config -----------

WARNING: Support for registration tokens and runner parameters in the 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/380872 
Registering runner... succeeded                     runner=NJrUkirc

Enter an executor: virtualbox, docker-autoscaler, docker+machine, instance, custom, docker, parallels, ssh, kubernetes, docker-windows, shell:
docker ------------

Enter the default Docker image (for example, ruby:2.7):
docker:20.10.16  ------------

Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
 
Configuration (with the authentication token) was saved in "/etc/gitlab-runner/config.toml" 

请添加图片描述
在这里插入图片描述

vim /srv/gitlab-runner/config/config.toml

volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock"]

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值