基于 GitLab Runner 官方仓库安装
官方仓库 UI 访问地址:https://packages.gitlab.com/ui/browse/runner/gitlab-runner
官方仓库 实际使用地址:https://packages.gitlab.com/runner/gitlab-runner
如果有 CentOS 仓库地址的经验,可以手动从 GitLab Runner 官方仓库下载安装
CentOS 源
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
sudo yum -y install gitlab-runner
类 CentOS 源
类 CentOS 7 源
sudo curl 'https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=centos&dist=7&source=script' --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' > /etc/yum.repos.d/runner_gitlab-runner.repo
sudo yum -y install gitlab-runner
类 CentOS 8 源
sudo curl 'https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=centos&dist=8&source=script' --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' > /etc/yum.repos.d/runner_gitlab-runner.repo
sudo yum -y install gitlab-runner
类 CentOS 9 源
sudo curl 'https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=centos&dist=9&source=script' --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' > /etc/yum.repos.d/runner_gitlab-runner.repo
sudo yum -y install gitlab-runner
类 CentOS 10 源
sudo curl 'https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=centos&dist=10&source=script' --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' > /etc/yum.repos.d/runner_gitlab-runner.repo
sudo yum -y install gitlab-runner
Debian 源
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt update
sudo apt -y install gitlab-runner
rpm 手动下载与安装
此操作基于 amazonaws 亚马逊对象储存,可能存在网络访问问题
rpm 下载
该链接是最新版本
如果下载指定版本,需要将链接中的
latest修改为具体的版本号,如:v19.0.1
gitlab-runner_loongarch64.rpm区分 CPU 架构,Architecture是loongarch64,见下方检查 rpm
gitlab-runner-helper-images.rpm不区分 CPU 架构,Architecture是noarch,见下方检查 rpm
curl -LO https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/rpm/gitlab-runner-helper-images.rpm
curl -LO https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/rpm/gitlab-runner_loongarch64.rpm
检查 rpm
rpm -qpi gitlab-runner-helper-images.rpm
rpm -qpi gitlab-runner_loongarch64.rpm
[root@anolis srv]# rpm -qpi gitlab-runner-helper-images.rpm
警告:gitlab-runner-helper-images.rpm: 头 V4 RSA/SHA512 Signature, 密钥 ID 6ba75a4e: NOKEY
Name : gitlab-runner-helper-images
Version : 19.0.1
Release : 1
Architecture: noarch
Install Date: (not installed)
Group : default
Size : 537123180
License : MIT
Signature : RSA/SHA512, 2026年05月30日 星期六 01时07分25秒, Key ID 6c57c29c6ba75a4e
Source RPM : gitlab-runner-helper-images-19.0.1-1.src.rpm
Build Date : 2026年05月30日 星期六 01时05分54秒
Build Host : runner-usvl75bct-project-250833-concurrent-18
Relocations : /
Packager : GitLab Inc. <support@gitlab.com>
Vendor : GitLab Inc.
URL : https://gitlab.com/gitlab-org/gitlab-runner
Summary : GitLab Runner Helper Docker Images
Description :
GitLab Runner Helper Docker Images
[root@anolis srv]#
[root@anolis srv]# rpm -qpi gitlab-runner_loongarch64.rpm
警告:gitlab-runner_loongarch64.rpm: 头 V4 RSA/SHA512 Signature, 密钥 ID 6ba75a4e: NOKEY
Name : gitlab-runner
Version : 19.0.1
Release : 1
Architecture: loongarch64
Install Date: (not installed)
Group : default
Size : 121430333
License : MIT
Signature : RSA/SHA512, 2026年05月30日 星期六 01时04分06秒, Key ID 6c57c29c6ba75a4e
Source RPM : gitlab-runner-19.0.1-1.src.rpm
Build Date : 2026年05月30日 星期六 01时03分55秒
Build Host : runner-usvl75bct-project-250833-concurrent-6
Relocations : /
Packager : GitLab Inc. <support@gitlab.com>
Vendor : GitLab Inc.
URL : https://gitlab.com/gitlab-org/gitlab-runner
Summary : GitLab Runner
Description :
GitLab Runner
[root@anolis srv]#
安装
yum localinstall -y gitlab-runner-helper-images.rpm
yum localinstall -y gitlab-runner_loongarch64.rpm
[root@anolis srv]# yum localinstall -y gitlab-runner-helper-images.rpm
上次元数据过期检查:0:09:32 前,执行于 2026年06月14日 星期日 10时44分33秒。
依赖关系解决。
===========================================================================================================================
软件包 架构 版本 仓库 大小
===========================================================================================================================
安装:
gitlab-runner-helper-images noarch 19.0.1-1 @commandline 515 M
事务概要
===========================================================================================================================
安装 1 软件包
总计:515 M
安装大小:512 M
下载软件包:
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
安装 : gitlab-runner-helper-images-19.0.1-1.noarch 1/1
运行脚本: gitlab-runner-helper-images-19.0.1-1.noarch 1/1
验证 : gitlab-runner-helper-images-19.0.1-1.noarch 1/1
已安装:
gitlab-runner-helper-images-19.0.1-1.noarch
完毕!
[root@anolis srv]#
[root@anolis srv]# yum localinstall -y gitlab-runner_loongarch64.rpm
上次元数据过期检查:0:11:01 前,执行于 2026年06月14日 星期日 10时44分33秒。
依赖关系解决。
===========================================================================================================================
软件包 架构 版本 仓库 大小
===========================================================================================================================
安装:
gitlab-runner loongarch64 19.0.1-1 @commandline 27 M
安装依赖关系:
git loongarch64 2.47.3-1.an23 os 49 k
git-core loongarch64 2.47.3-1.an23 os 4.9 M
git-core-doc noarch 2.47.3-1.an23 os 2.7 M
perl-Error noarch 1:0.17029-3.an23 os 33 k
perl-File-Find noarch 1.40-18.an23 os 24 k
perl-Git noarch 2.47.3-1.an23 os 35 k
perl-TermReadKey loongarch64 1:2.38-3.an23 os 28 k
perl-lib loongarch64 0.65-18.an23 os 14 k
事务概要
===========================================================================================================================
安装 9 软件包
总计:35 M
总下载:7.8 M
安装大小:156 M
下载软件包:
(1/8): git-2.47.3-1.an23.loongarch64.rpm 419 kB/s | 49 kB 00:00
(2/8): perl-Error-0.17029-3.an23.noarch.rpm 459 kB/s | 33 kB 00:00
(3/8): git-core-doc-2.47.3-1.an23.noarch.rpm 1.3 MB/s | 2.7 MB 00:02
(4/8): perl-File-Find-1.40-18.an23.noarch.rpm 13 kB/s | 24 kB 00:01
(5/8): perl-TermReadKey-2.38-3.an23.loongarch64.rpm 369 kB/s | 28 kB 00:00
(6/8): perl-lib-0.65-18.an23.loongarch64.rpm 16 kB/s | 14 kB 00:00
(7/8): git-core-2.47.3-1.an23.loongarch64.rpm 1.6 MB/s | 4.9 MB 00:03
(8/8): perl-Git-2.47.3-1.an23.noarch.rpm 18 kB/s | 35 kB 00:02
---------------------------------------------------------------------------------------------------------------------------
总计 1.9 MB/s | 7.8 MB 00:04
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
安装 : git-core-2.47.3-1.an23.loongarch64 1/9
安装 : git-core-doc-2.47.3-1.an23.noarch 2/9
安装 : perl-lib-0.65-18.an23.loongarch64 3/9
安装 : perl-TermReadKey-1:2.38-3.an23.loongarch64 4/9
安装 : perl-File-Find-1.40-18.an23.noarch 5/9
安装 : perl-Error-1:0.17029-3.an23.noarch 6/9
安装 : perl-Git-2.47.3-1.an23.noarch 7/9
安装 : git-2.47.3-1.an23.loongarch64 8/9
安装 : gitlab-runner-19.0.1-1.loongarch64 9/9
运行脚本: gitlab-runner-19.0.1-1.loongarch64 9/9
GitLab Runner: creating gitlab-runner...
Home directory skeleton not used
Runtime platform arch=loong64 os=linux pid=39319 revision=c2831b75 version=19.0.1
gitlab-runner: the service is not installed
Runtime platform arch=loong64 os=linux pid=39334 revision=c2831b75 version=19.0.1
gitlab-ci-multi-runner: the service is not installed
Runtime platform arch=loong64 os=linux pid=39374 revision=c2831b75 version=19.0.1
Runtime platform arch=loong64 os=linux pid=39475 revision=c2831b75 version=19.0.1
INFO: Docker installation not found, skipping clear-docker-cache
验证 : git-2.47.3-1.an23.loongarch64 1/9
验证 : git-core-2.47.3-1.an23.loongarch64 2/9
验证 : git-core-doc-2.47.3-1.an23.noarch 3/9
验证 : perl-Error-1:0.17029-3.an23.noarch 4/9
验证 : perl-File-Find-1.40-18.an23.noarch 5/9
验证 : perl-Git-2.47.3-1.an23.noarch 6/9
验证 : perl-TermReadKey-1:2.38-3.an23.loongarch64 7/9
验证 : perl-lib-0.65-18.an23.loongarch64 8/9
验证 : gitlab-runner-19.0.1-1.loongarch64 9/9
已安装:
git-2.47.3-1.an23.loongarch64 git-core-2.47.3-1.an23.loongarch64 git-core-doc-2.47.3-1.an23.noarch
gitlab-runner-19.0.1-1.loongarch64 perl-Error-1:0.17029-3.an23.noarch perl-File-Find-1.40-18.an23.noarch
perl-Git-2.47.3-1.an23.noarch perl-TermReadKey-1:2.38-3.an23.loongarch64 perl-lib-0.65-18.an23.loongarch64
完毕!
[root@anolis srv]#
查看 GitLab Runner 服务
systemctl status gitlab-runner.service -l --no-pager
[root@anolis srv]# systemctl status gitlab-runner.service -l --no-pager
● gitlab-runner.service - GitLab Runner
Loaded: loaded (/etc/systemd/system/gitlab-runner.service; enabled; preset: disabled)
Active: active (running) since Sun 2026-06-14 10:55:48 CST; 4min 13s ago
Main PID: 39488 (gitlab-runner)
Tasks: 12 (limit: 18112)
Memory: 16.7M (peak: 26.2M)
CPU: 141ms
CGroup: /system.slice/gitlab-runner.service
└─39488 /usr/bin/gitlab-runner run --config /etc/gitlab-runner/config.toml --working-directory /home/gitlab-runner --service gitlab-runner --user gitlab-runner
6月 14 10:55:48 anolis gitlab-runner[39488]: Runtime platform arch=loong64 os=linux pid=39488 revision=c2831b75 version=19.0.1
6月 14 10:55:48 anolis gitlab-runner[39488]: Starting multi-runner from /etc/gitlab-runner/config.toml... builds=0 max_builds=0
6月 14 10:55:48 anolis gitlab-runner[39488]: Running in system-mode.
6月 14 10:55:48 anolis gitlab-runner[39488]:
6月 14 10:55:48 anolis gitlab-runner[39488]: Created missing unique system ID system_id=s_8facf33c7e20
6月 14 10:55:48 anolis gitlab-runner[39488]: Usage logger disabled builds=0 max_builds=1
6月 14 10:55:48 anolis gitlab-runner[39488]: Configuration loaded builds=0 max_builds=1
6月 14 10:55:48 anolis gitlab-runner[39488]: listen_address not defined, metrics & debug endpoints disabled builds=0 max_builds=1
6月 14 10:55:48 anolis gitlab-runner[39488]: [session_server].listen_address not defined, session endpoints disabled builds=0 max_builds=1
6月 14 10:55:48 anolis gitlab-runner[39488]: Initializing executor providers builds=0 max_builds=1
[root@anolis srv]#
注册 GitLab Runner
gitlab-runner register
[root@anolis srv]# gitlab-runner register
Runtime platform arch=loong64 os=linux pid=58576 revision=c2831b75 version=19.0.1
Running in system-mode.
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://gitlab.xuxiaowei.com.cn/
Enter the registration token:
GR1348941YZqnrEveNky56kNQJQaX
Enter a description for the runner:
[anolis]: anolis-Loongson-3A5000-shell
Enter tags for the runner (comma-separated):
anolis-Loongson-3A5000-shell
Enter optional maintenance note for the runner:
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://docs.gitlab.com/ci/runners/new_creation_workflow/
Registering runner... succeeded correlation_id=01KV21HD3FRYJ91EYJZ907BH7P runner=YZqnrEveN runner_name=anolis-Loongson-3A5000-shell
Enter an executor: virtualbox, shell, custom, docker, docker-windows, docker+machine, kubernetes, ssh, parallels, instance, docker-autoscaler:
shell
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"
[root@anolis srv]#
使用 root 用户运行 GitLab Runner
以下设置在升级 GitLab Runner 后将失效,需要重新设置一次
使用 root 用户执行流水线可能会涉及流水线危险操作,如:使用 Shell 执行器执行
rm -rf /
推荐使用 Docker 执行器
# 查看当前 runner 运行的用户
ps aux | grep gitlab-runner
# 删除gitlab-runner
sudo gitlab-runner uninstall
# 安装并设置--user(例如我想设置为root)
sudo gitlab-runner install --working-directory /home/gitlab-runner --user root
# 重启gitlab-runner
sudo service gitlab-runner restart
# 再次执行会发现--user的用户名已经更换成root了
ps aux | grep gitlab-runner