Docker container cannot resolve request to service in another container
I’m running gitlab-ce and gitlab-ci-multi-runner in separated docker containers, but on the same server.
Gitlab CE works fine, I can access it via browser and clone projects using both http and ssh.
However my runner cannot connect to Gitlab using domain/server ip. It can connect to it only via local docker network (for example using ip address 172.17.0.X or, if linked, by using service alias).
Ping to domain/server ip returns response.
I tried to link it as gitlab:example.domain.com but it didn’t work, as somehow runner resolved server ip address instead of local network address
Checking for builds... failed: couldn't execute POST against http://example.domain.com/ci/api/v1/builds/register.json: Post http://example.domain.com/ci/api/v1/builds/register.json: dial tcp server.ip:80: i/o timeout
gitlab: image: gitlab/gitlab-ce:8.2.2-ce.0 hostname: domain.name privileged: true volumes: - ./gitlab-config:/etc/gitlab - ./gitlab-data:/var/opt/gitlab - ./gitlab-logs:/var/log/gitlab restart: always ports: - server.ip:22:22 - server.ip:80:80 - server.ip:443:443 runner: image: gitlab/gitlab-runner:alpine restart: always volumes: - ./runner-config:/etc/gitlab-runner - /var/run/docker.sock:/var/run/docker.sock
I have no clue what’s the issue here.
I’d appreciate your help.
Thanks in advance! 🙂
One Solution collect form web for “Docker container cannot resolve request to service in another container”
Seems like it was a firewall problem. Unlocking docker0 interface allowed traffic from containers 🙂