在dockerized 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)。我该如何设置?
答案 0 :(得分:3)
当您在http://localhost:4311
中输入gitlab-ci
时,实际上localhost
指的是内容器中的主机。这不是您本地PC的localhost
。因此gitlab-ci
无法连接到gitlab
。
我建议您使用docker-compose来编排多个容器。