gitlab-runner 注册问题
系统:Ubuntu 18.04.1 LTSgitlab版本:11.9使用gitlab服务器域名:https://gitlab.example.com需要使用到url和token:gitlab服务器地址+/admin/runners要在GNU / Linux下注册Runner:运行以下命令:gitlab-runner register输入您的GitLa...
文章共643字 · 阅读需要大约3分钟
一键AI生成摘要,助你高效阅读
问答
·
系统:Ubuntu 18.04.1 LTS
gitlab版本:11.9
使用gitlab服务器域名:https://gitlab.example.com
需要使用到url和token:gitlab服务器地址+/admin/runners
要在GNU / Linux下注册Runner:
-
运行以下命令:
gitlab-runner register
-
输入您的GitLab实例URL:
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com ) https://gitlab.com
-
输入您获得的令牌以注册Runner:
Please enter the gitlab-ci token for this runner xxx
-
输入Runner的描述,您可以稍后在GitLab的UI中更改:
Please enter the gitlab-ci description for this runner [hostame] my-runner
-
输入与Runner关联的标签,您可以稍后在GitLab的UI中更改:
Please enter the gitlab-ci tags for this runner (comma separated): my-tag,another-tag
-
输入Runner执行程序:
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell: docker
-
如果您选择Docker作为执行程序,则会要求您将默认图像用于未在其中定义的项目
.gitlab-ci.yml
:Please enter the Docker image (eg. ruby:2.1): alpine:latest
第五步报错,报错信息如下:
ERROR: Registering runner... failed runner=6HkNBVen status=couldn't execute POST against https://gitlab.example.com/api/v4/runners: Post https://gitlab.example.com/api/v4/runners: x509: certificate signed by unknown authority
PANIC: Failed to register this runner. Perhaps you are having network problems
证书签名错误,在网上找了许多办法还是不行,解决办法:
gitlab-runner register \
--non-interactive \
--tls-ca-file=/etc/gitlab/ssl/gitlab.example.com.crt \
--url "https://gitlab.example.com/" \
--registration-token "6HkNBVenPd9sMyd2HzhK" \
--executor "docker" \
--docker-image maven:latest \
--description "runner " \
--tag-list "run" \
--run-untagged \
--locked="false"
找到gitlab文件夹下,就看到了,把证书文件带上
其他版本注册方式:
更多推荐
已为社区贡献3条内容
所有评论(0)