gitlab runner使用docker报错(x509: certificate signed by unknown authority)定位

时间:2021-10-23 05:52:18

如果gitlab runner使用docker,docker是普通配置,配置好后,runner就可以正常执行任务了。

另外一个环节Docker配置了tls加密连接,添加runner后,runner的配置tls_verify 字段值为true:

tls_verify = true

执行任务时则会报错:

ERROR: Preparation failed: error during connect: Get https://127.0.0.1:2376/v1.25/info: x509: certificate signed by unknown authority (executor_docker.go:979:0s)

搜索错误原因,提示是docker找不到tls相关的证书,但是git-runner的主机上已经配置好了证书,docker命令可以正常执行。

仔细阅读gitlab文档,在https://docs.gitlab.com/runner/configuration/advanced-configuration.html里发现了tls_cert_path这个参数,

用来配置tls证书的路径的。

在gitlab-runner的配置文件路径下/etc/gitlab-runner/config.toml,打开文件,

在runner中配置runner.docker的tls_cert_path字段值为tls文件所在路径,然后重启gitlab-runner即可

[[runners]]

  name = "root_test2"

  url = "http://10.10.10.10/"

  token = "df6bcfdbb75332d19a7712ca23b130"

  executor = "docker"

  [runners.custom_build_dir]

  [runners.docker]

    host = "tcp://127.0.0.1:2376"

    tls_verify = true

    tls_cert_path = "/root/.docker/"

    image = "gitlab:lasted"

    privileged = false

    disable_entrypoint_overwrite = false

    oom_kill_disable = false

    disable_cache = false

    volumes = ["/root/.docker:/root/.docker","/cache"]

    shm_size = 0

  [runners.cache]

    [runners.cache.s3]

    [runners.cache.gcs]

gitlab runner使用docker报错(x509: certificate signed by unknown authority)定位的更多相关文章

  1. docker push 出现:x509: certificate signed by unknown authority

    今天,部署生产的程序的时候,出现一个问题:编译正常,但是,docker 把编译好的image 推送到生产环境上去的时候,出现:x509: certificate signed by unknown a ...

  2. docker从私有镜像库pull/push镜像问题:Error response from daemon: Get https://xxxx.com/: x509: certificate signed by unknown authority

    docker从私有镜像库pull/push镜像问题:Error response from daemon: Get https://harbor.op.xxxx.com/v2/: x509: cert ...

  3. 解决go mod或go get时`x509: certificate signed by unknown authority`错误

    一般go get私有仓库时会出现如下错误: go: xxx@v0.0.0-20190918102752-bb51b27911ca: unrecognized import path "xxx ...

  4. Unable to connect to the server: x509: certificate signed by unknown authority

    0x00 Problem 在使用二进制搭建 k8s 集群的过程中,使用 kubectl get 等操作时始终显示 x509: certificate signed by unknown authori ...

  5. golang GET 出现 x509: certificate signed by unknown authority

    我们编写一个Go程序来尝试与这个HTTPS server建立连接并通信. //gohttps/4-https/client1.gopackage main import (    "fmt& ...

  6. docker报错: x509: certificate has expired or is not yet valid

    环境:最小化安装centos7 问题:docker 启动没问题,但是查询 镜像时报错 Error response from daemon: Get https://index.docker.io/v ...

  7. x509: certificate signed by unknown authority harbor 架构图

    默认时,client 与 Registry 的交互是通过 https 通信的.在 install Registry 时,若未配置任何tls 相关的 key 和 crt 文件,https 访问必然失败. ...

  8. go使用websocket遇到dial:x509: certificate signed by unknown authority

    websocket.DefaultDialer.Dial(url, headers) 改为 websocket.Dialer{TLSClientConfig: &tls.Config{Root ...

  9. Docker 报错 error during connect: Get pipe/docker_engine: The system cannot find the file specified. - 摘要: 本文讲的是Docker 报错 error during connect: Get pipe/dock

    error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/version: open //./pipe/docker_ ...

随机推荐

  1. 17.3---阶乘尾多少个0(CC150)

    思路,其实这题easy,就是看多少个5. 答案: public static int getFactorSuffixZero(int n) { // write code here int res = ...

  2. 【python】入门学习(一)

    主要记录一下与C语言不同的地方和特别需要注意的地方: // 整除 ** 乘方 整数没有长度限制,浮点数有长度限制 复数: >>> 1j*1j (-1+0j) 导入模块: import ...

  3. Security » Authentication » Identity介绍

    Introduction to Identity¶ By Pranav Rastogi, Rick Anderson, Tom Dykstra, Jon Galloway and Erik Reita ...

  4. 2.前端笔记之css

    title: 1.前端笔记之CSS date: 2016-04-05 23:05:51 tags: 前端 categories: w3c --- 作者:刘耀 **出处:http://www.liuya ...

  5. hunnu Sum of f(x)

    http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11546&courseid=0 Sum of f(x) ...

  6. 解决PopupWindow遮住输入法

    1: PopupWindow中的设置 pop.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED); pop.setSoftInputMode(Win ...

  7. 集成JPA+springmvc+spring+EJB中的Java EE应用

    EJB是sun的JavaEE服务器端组件模型,设计目标与核心应用是部署分布式应用程序.凭借java跨平台的优势,用EJB技术部署的分布式系统可以不限于特定的平台.EJB (Enterprise Jav ...

  8. Vue.js 2.x笔记:路由Vue Router(6)

    1. Vue Router简介与安装 1.1 Vue Router简介 Vue Router 是 Vue.js 官方的路由管理器.它和 Vue.js 的核心深度集成,构建单页面应用. Vue Rout ...

  9. CodeForces - 867E Buy Low Sell High (贪心 +小顶堆)

    https://vjudge.net/problem/CodeForces-867E 题意 一个物品在n天内有n种价格,每天仅能进行买入或卖出或不作为一种操作,可以同时拥有多种物品,问交易后的最大利益 ...

  10. 创建dblink

    创建dblinkcreate database link user1_Link_app--dblink名称----connect to ehl_app ----远程数据库名称----identifie ...