[root@qijing0 ~]# docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
Runtime platform arch=amd64 os=linux pid=7 revision=6d480948 version=15.7.1
Running in system-mode.
Enter the GitLab instance URL (for example, https://gitlab.com/):
http://192.168.3.1:10000/
Enter the registration token:
GR1348941J1DsxtL4DTjyshfq48kv
Enter a description for the runner:
[92fb28d0fb0a]: deploy-runner
Enter tags for the runner (comma-separated):
deploy
Enter optional maintenance note for the runner:
qijing
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=GR1348941J1DsxtL4
Enter an executor: instance, kubernetes, ssh, virtualbox, docker+machine, docker-ssh+machine, shell, custom, docker, docker-ssh, parallels:
docker
Enter the default Docker image (for example, ruby:2.7):
centos:7
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"
四、使用runnner
点击【浏览群组】、点击【CI/CD】、点击【Runnner】
可以看到,这是配置好的 Runner了
五、运行runner运行在没有标签的项目上
把【指示此runner是否可以选择无标记的作业】勾上,不然作业会阻塞
[附加]解决runner Failed to connect to gitlab.xxxx port xxx after ms: Operation timed out