0
点赞
收藏
分享

微信扫一扫

gitlab-runner 注册问题 x509 certificate signed by unknown authority


系统:Ubuntu 18.04.1 LTS

gitlab版本:11.9

使用gitlab服务器域名:​​https://gitlab.example.com​​

需要使用到url和token:gitlab服务器地址+/admin/runners

gitlab-runner 注册问题 x509 certificate signed by unknown authority_docker

要在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中更改:

<pre class="has" style="margin-left:0px;" name="code"><code class="language-highlight">Please enter the gitlab-ci description for this runner

[hostame] my-runner

输入​​与Runner关联​​​的​​标签​​​,您可以稍后在GitLab的UI中更改:
· 

<pre class="has" style="margin-left:0px;" name="code"><code class="language-highlight">Please enter the gitlab-ci tags for this runner (comma separated):

my-tag,another-tag

输入​​Runner执行程序​​:

<pre class="has" style="margin-left:0px;" name="code"><code class="language-highlight">Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:

docker

如果您选择Docker作为执行程序,则会要求您将默认图像用于未在其中定义的项目.gitlab-ci.yml:

<pre class="has" style="margin-left:0px;" name="code"><code class="language-highlight">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文件夹下,就看到了,把证书文件带上

gitlab-runner 注册问题 x509 certificate signed by unknown authority_docker_02

其他版本注册方式:

​​https://docs.gitlab.com/11.9/runner/register/index.html​​

 

举报

相关推荐

0 条评论