2017-10-13 127 views
0

在一个dockerized gitlab浇道的bash:为什么我无法将dockerized gitlab runner连接到dockerized gitlab ci?

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

你如何运行'gitlab'和'gitlab-runnet'。你能告诉我们一些'docker-compose'文件,或者运行这个容器的命令。 –

+0

实际上我做码头运行gitlab/gitlab-ce和码头运行gitlab/gitlab-runner。然后在kitematic中我转发gitlab-ce的端口(22,80,443) – koller23

回答

2

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

我建议您使用docker-compose来编排几个容器。