无法配置/注册dockerized gitlab运行程序

时间:2019-01-27 14:04:26

标签: docker gitlab gitlab-ci-runner

我的容器正在运行gitlab

我也尝试通过this文章对dockerized gitlab runner进行设置。

首先,我尝试通过以下方式运行gitlabRunner:

docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest

日志说:

...
Listen address not defined, session server disabled  builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory  builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory  builds=0
...

我还尝试通过{{3}}文章注册亚军:

docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register

5步后:

Please enter the gitlab-ci tags for this runner (comma separated):
 my-tag,another-tag

我收到错误消息:

ERROR: Registering runner... failed                 runner=KuwydETA status=couldn't execute POST against http://localhost/api/v4/runners: Post http://localhost/api/v4/runners: dial tcp 127.0.0.1:80: getsockopt: connection refused
PANIC: Failed to register this runner. Perhaps you are having network problems

1 个答案:

答案 0 :(得分:0)

在/ srv / gitlab-runner / config目录中,您需要插入config.toml文件。

访问:https://docs.gitlab.com/runner/examples/gitlab.html

https://docs.gitlab.com/runner/configuration/advanced-configuration.html