gpt4 book ai didi

docker - 为什么我不能将 dockerized gitlab runner 连接到 dockerized gitlab ci?

转载 作者:行者123 更新时间:2023-12-02 18:03:14 28 4
gpt4 key购买 nike

在 docker 化的 gitlab-runner bash 上:

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://localhost:4311
Please enter the gitlab-ci token for this runner:
xxxxxxxxxxxx
Please enter the gitlab-ci description for this runner:
[runner]: dockerizedrunner
Please enter the gitlab-ci tags for this runner (comma separated):
powershell
Whether to run untagged builds [true/false]:
[false]: true
Whether to lock Runner to current project [true/false]:
[false]: false
ERROR: Registering runner... failed runner=xxxxxx status=couldn't execute POST against http://localhost:4364/api/v4/runners: Post http://localhost:4364/api/v4/runners: dial tcp 127.0.0.1:4311: getsockopt: connection refused
PANIC: Failed to register this runner. Perhaps you are having network problems

我尝试使用 3 个转发端口(22,80,443 转发到 4311,4312,4313)。我该如何设置?

最佳答案

当你在gitlab-ci中输入http://localhost:4311时,实际上localhost指的是主机里面 容器。这不是您本地 PC 的 localhost。因此 gitlab-ci 无法连接到 gitlab

我推荐你使用docker-compose编排多个容器。

关于docker - 为什么我不能将 dockerized gitlab runner 连接到 dockerized gitlab ci?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46729522/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com