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_第1张图片

要在GNU / Linux下注册Runner:

  1. 运行以下命令:

    gitlab-runner register
  2. 输入您的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

      第五步报错,报错信息如下:

    
       
       
       
       
    1. 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
    2. PANIC: Failed to register this runner. Perhaps you are having network problems


    证书签名错误,在网上找了许多办法还是不行,解决办法:

    
       
       
       
       
    1. gitlab-runner register \
    2. --non-interactive \
    3. --tls-ca-file=/etc/gitlab/ssl/gitlab.example.com.crt \
    4. --url "https://gitlab.example.com/" \
    5. --registration-token "6HkNBVenPd9sMyd2HzhK" \
    6. --executor "docker" \
    7. --docker-image maven:latest \
    8. --description "runner " \
    9. --tag-list "run" \
    10. --run-untagged \
    11. --locked="false"

    找到gitlab文件夹下,就看到了,把证书文件带上

    其他版本注册方式:

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

    你可能感兴趣的:(gitlab)