Docker container of runner don't resolve host
Hi.
On OpenSuse Tumbleweed I install gitlab from script for OpenSuse 42.3. Install and register runner, import project from git and try build. Runner configured as docker. It take image, start container, but cant clone project from server. I tried cloning manual with token (via http) - all good.
In /etc/gitlab/gitlab.rb: external_url 'http://work-pc/gitlab'
, in /etc/gitlab-runner/config.toml I put extra_hosts = [“work-pc:192.168.1.1”]
.
And runner say me next:
Running with gitlab-runner 11.6.0 (f100a208)
on first ******
Using Docker executor with image ubuntu:18.04 ...
Pulling docker image ubuntu:18.04 ...
Using docker image sha256:1d9c17228a9e80a0a23927f24f3cf17d012cf0bb3eae5e3541a8c6987ab9bd5a for ubuntu:18.04 ...
Running on runner... via work-pc...
Cloning repository...
Cloning into '/builds/gitlab/root/project0'...
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@work-pc/gitlab/root/project0.git/': Could not resolve host: work-pc
/bin/bash: line 62: cd: /builds/gitlab/root/project0: No such file or directory
ERROR: Job failed: exit code 1
For this trouble I found only - "add extra_hosts = [“server:IP”]". But it dont work. Docker not docker-composer. Docker version 18.09.0, build e68fc7a215d7 gitlab and gitlab-runner install locally, not as docker images.
Edited by 🤖 GitLab Bot 🤖