相关疑难解决方法(0)

Gitlab runner docker无法解析主机

我在我的Ubuntu OS上使用了2个容器:Gitlab-ce和gitlab-runner

容器名称是:gitlab_gitlab_1gitlab_gitlab-runner_1

我通过访问我的gitlab应用程序 gitlab.localhost.com:801

我用这个命令成功注册了一个跑步者:

docker exec -it gitlab_gitlab-runner_1 gitlab-runner register --non-interactive --url http://gitlab_gitlab_1 --registration-token _wgMgEx3nBocYQtoi83c --executor docker --docker-image alpine:latest
Run Code Online (Sandbox Code Playgroud)

然后,当我开始工作时,我收到此错误消息:

Running with gitlab-runner 10.7.1 (b9bba623)
  on 589a617ee407 12ba77f7
Using Docker executor with image alpine:latest ...
Pulling docker image alpine:latest ...
Using docker image sha256:3fd9065eaf02feaf94d68376da52541925650b81698c53c6824d92ff63f98353 for alpine:latest ...
Running on runner-12ba77f7-project-1-concurrent-0 via 01196621a827...
Cloning repository...
Cloning into '/builds/root/test'...
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.localhost.com/root/test.git/': Could not resolve host: gitlab.localhost.com
ERROR: Job failed: exit code 1
Run Code Online (Sandbox Code Playgroud)

在这两个容器中,我都可以访问主机名gitlab.localhost.com …

docker gitlab-ci gitlab-ci-runner

9
推荐指数
3
解决办法
1万
查看次数

标签 统计

docker ×1

gitlab-ci ×1

gitlab-ci-runner ×1