# 003GitlabRunner部署

作者:Odboy (opens new window)

本站地址:https://blog.odboy.cn (opens new window)

# 前置条件

由于我们使用docker容器构建,所以必须要先安装docker环境,可以参考这两篇文章

安装配置docker

docker国内拉取镜像被墙解决

# 下载对应平台的Runner二进制文件

# https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v17.5.2
curl -O https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v17.5.2/downloads/binaries/gitlab-runner-linux-amd64

# 下载完毕后执行
mv gitlab-runner-linux-amd64 /usr/local/bin/gitlab-runner
chmod +x /usr/local/bin/gitlab-runner
mkdir /root/GitlabRunner
gitlab-runner install --user=root --working-directory=/root/GitlabRunner
gitlab-runner status
gitlab-runner list
1
2
3
4
5
6
7
8
9
10

# 注册Runner

gitlab-runner register  --url http://192.168.100.128:20080  --token glrt-t1_LpWykWzVAtV7ghiPhqme

## Enter the GitLab instance URL (for example, https://gitlab.com/):
回车

## Enter a name for the runner. This is stored only in the local config.toml file:
输入Runner名称 回车

## Enter an executor
docker 回车

## Enter the default Docker image (for example, ruby:2.7):
registry.cn-shanghai.aliyuncs.com/odboy/ops:alinux3 回车
1
2
3
4
5
6
7
8
9
10
11
12
13

注册Runner

# 注销Runner

gitlab-runner list
gitlab-runner stop --name [Runner名称] --token [Runner Token]
gitlab-runner unregister --name [Runner名称] --token [Runner Token]
1
2
3
最近更新: 2025-08-07
2017 - 武林秘籍   |