How to connect a container which is created by docker executor to docker overlay network

I'm trying gitlab CI with the official php CI test but it seems to fail git clone. My Gitlab CE is in a docker container with docker overlay network, so that I'm guessing that a container what is created by gitlab-runner needs docker overlay network because the container is not in the same network of Gitlab CE. But I don't know how to connect it.

I always get one error of the following lines.

fatal: unable to access 'http://gitlab-ci-token:xxxxxx@gitlab01.mynetwork.com/my/my_tool.git/': Couldn't resolve host 'gitlab01.mynetwork.com'
fatal: unable to access 'http://gitlab-ci-token:xxxxxx@gitlab01.mynetwork.com/my/my_tool.git/': Failed to connect to gitlab01.mynetwork.com port 80: Operation timed out
fatal: unable to access 'http://gitlab-ci-token:cc766954a607a348e8627fb9a32768@gitlab01.mynetwork.com/my/my_tool.git/': The requested URL returned error: 503

When I got the error Couldn't resolve host, tried to solve it with adding extra_hosts = ["gitlab01.mynetwork.com:172.30.100.100"] then another messages above would be shown.

Here are my system.

  • docker host
  • ubuntu16, docker 1.11.1
  • Gitlab CE
  • sameersbn/docker-gitlab:8.9.3
    • with overlay network "MYNETWORK"
  • Gitlab Runner
  • gitlab-ci-multi-runner:1.3.2(This project)
    • with overlay network "MYNETWORK"
    • with docker.sock volume

And one more question about local IPs. My gitlab-CE container has two IPs. One is bridge and one is overlay. When the docker host accesses to CE, use bridge-IP. When a docker container accesses to CE, use overlay-IP. I think that a container which is created by gitlab-runner is not using docker.sock so that it needs overlay network IP not bridge's. Am I right?

I hope someone helps me!

Assignee Loading
Time tracking Loading