Gitlab-runner from Docker container hanging in register process


I’m trying to run a gitlab-runner inside of a docker container. I’ve been following the gitlab-ci get started docs, and here is how i’ve installed the image:

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 \

I’ve started the runner using:

docker exec gitlab-runner gitlab-runner start

Then I start the registration process using:

docker exec gitlab-runner gitlab-runner register

And after I input the gitlab URL on the first prompt it seems to hang with no further output:

Please enter the gitlab-ci coordinator URL (e.g.

I am hosting gitlab locally in a virtual machine. On that same virtual machine I am running the dockerized runner.

Does this resolve to an IP address? Have you correctly configured your Virtualbox network?

I think so although my experience with networking is very low so I’m not so good when it comes to network configuration. But my /etc/hosts file says	localhost	jonathan-VirtualBox

And I can visit ‘http://jonathan-VirtualBox’ in a browser and it will take me to the gitlab instance

While the Docker container will use its host’s /etc/hosts for DNS resolution, is a loopback address - I suspect this means the Docker container is trying to connect to itself, not the host’s processes.

The host should have an IP address similar to 10.0.2.* (check with ip a) - try adding that to the host’s /etc/hosts instead of, e.g. jonathan-virtualbox
1 Like

from ip a i found enp0s3: with an ip of, i added this to my etc hosts file:	localhost	jonathan-VirtualBox

but the hanging behaviour remains the same. I can still visit gitlab in the browser and its using the new ip.

Same problem. And I’m sure the GitLab host is reachable.