一、版本信息
gitlab 15.5.4-ee
二、安装gitlab-runner
1、使用docker版本
docker pull gitlab/gitlab-runner:latest
2、创建目录
mkdir -p /home/apps/gitlab-runner/config
3、启动runner
docker run -d --name gitlab-runner \
-v /home/apps/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
--net=host \
--restart always \
--privileged=true \
gitlab/gitlab-runner:latest
三、注册runner
[root@hyperv01 ~]# docker exec -ti 76fb32f22f7d /bin/bash
root@hyperv01:/# gitlab-runner register
Runtime platform arch=amd64 os=linux pid=22 revisinotallow=0d4137b8 versinotallow=15.5.0
Running in system-mode.
Enter the GitLab instance URL (for example, https://gitlab.com/):
http://10.0.0.11
Enter the registration token:
xCSHukMrhb8giYxZ9tJA
Enter a description for the runner:
[hyperv01]: gitlabrunner
Enter tags for the runner (comma-separated):
build,deploy
Enter optional maintenance note for the runner:
docker
Registering runner... succeeded runner=xCSHukMr
Enter an executor: virtualbox, docker+machine, kubernetes, custom, docker, docker-ssh, docker-ssh+machine, instance, parallels, shell, ssh:
docker
Enter the default Docker image (for example, ruby:2.7):
alpine:latest
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"
绿色,已激活runner
引自:https://blog.csdn.net/JineD/article/details/116158728