2017-10-13 124 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來編排幾個容器。