Beginner here :)

I’ve set up a Gitlab instance on my company’s local network. It is hosted in a docker container, running on a dedicated server, whose hostname is “devserver” This Gitlab instance is reachable via “https://mycompanygit”, because the network DNS is set to redirect mycompanygit to the local ip of devserver. On devserver, there is another container running, a nginx reverse-proxy, which redirects http and https requests for mycompanygit to the gitlab container. Now I’d like to add a third container, a Gitlab-runner instance. So I run the following command, taken from here.

docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner --name gitlab-runner gitlab/gitlab-runner register \
  --non-interactive \
  --executor "docker" \
  --docker-image alpine:3 \
  --url "https://mycompanygit" \
  --registration-token "MY_REGISTRATION_TOKEN" \
  --description "docker-runner" \
  --tag-list "docker,aws" \
  --run-untagged \

I get:

ERROR: Registering runner... failed                 runner=i3ygCNvW status=couldn't execute POST against https://mycompanygit/api/v4/runners: Post https://mycompanygit/api/v4/runners: dial tcp: lookup mycompanygit on no such host
PANIC: Failed to register this runner. Perhaps you are having network problems

How do I get the Gitlab-runner to see the Gitlab instance ? I don’t even know if it’s related to Docker or Gitlab ?

Also: the gitlab and nginx instances have been setup together with docker-compose, does that matter?

Thanks a lot :) Please tell me if I’m not clear, I’ll try to reformulate

1 Answer 1


The GitLab Runner cannot resolve an ip for the the GitLab instance because it is using Google's DNS for domain name resolution, and Google's DNS knows nothing about mycompanygit. See the end of your ERROR line:

... lookup mycompanygit on no such host

The simplest solution would be to put in the ip address you used in your company DNS for the host mycompanygit into the GitLab-runner config and not bother with DNS for the runner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.