linux - 无法在本地网络服务器上注册 git runner

标签 linux git ubuntu server gitlab

我正在尝试在我公司的本地网络服务器上注册一个 git runner,gitlab 使用自签名证书工作正常,但是当尝试像这样注册一个 git runner 时

sudo gitlab-runner register --tls-ca-file=/home/gitlab-runner/certs/git.crt

然后粘贴git URL

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/)
https://git.mycompany/

然后是 token :

Please enter the gitlab-ci token for this runner: 
TOKEN

然后是描述和标签,然后我得到这个错误:

ERROR: Registering runner... failed   
runner=TOKEN status=couldn't execute POST against https://git.mycompany/api/v4/runners:
Post https://git.mycompany/api/v4/runners: 
dial tcp: lookup git.mycompany on 127.0.0.53:53: 
no such host
PANIC: Failed to register this runner. Perhaps you are having network problems

我没有使用 docker,只是正常设置,请提供任何帮助,非常感谢

enter image description here

更新:

我将 DNS 服务器的名称服务器添加到/etc/resolv.conf,最后一个错误消失了,但我有新的错误:

 x509: certificate has expired or is not yet valid

即使我将 .crt 的运行者注册为 documentation

sudo gitlab-runner register --tls-ca-file /path/to/some-host-gitlab.com.crt

自签名证书

enter image description here

更新

从 6/5/2019 到 7/5/2019 有效的证书如果是自签名证书是否重要?

enter image description here

最佳答案

关于 DNS 问题,您必须更改 /etc/resolv.conf 中的 DNS 服务器,并将您的 nameserver 设置为您的 DNS。

对于证书,Gitlab 运行器默认检查系统证书存储并根据存储在系统中的 CA 验证 Gitlab 服务器。要将您的证书添加到系统中,您应该将受信任的证书添加到 /usr/local/share/ca-certificates/ 并执行 sudo update-ca-certificates。或者您可以在注册运行者时将证书设置为参数--tls-ca-file

我建议创建一个具有更多验证天数的新证书。 (不要忘记在 apache2 或 ngix 中更改 gitlab 配置中的证书路径。

关于linux - 无法在本地网络服务器上注册 git runner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57622845/

相关文章:

c - 如何在 TCP/IP 堆栈中启用 tcp psh 标志?

Github,在 master : active users 之前 fork 存储库

windows - Git 克隆在 Windows 10 中显示错误并将文件标记为已删除

git - 无法推送到 GitLab

linux - 即使提取成功,解压缩也会返回退出代码 1

linux ftp命令行获取具有特定名称的文件

python - 帮助我理解为什么 Unicode 有时只适用于 Python

ubuntu - ubuntu 中的 CPUSTATES uint64_ts (user, nice, sys, intr, idle) 数组

c - 生产者/消费者使用信号量

git - 备份git有没有并发问题?