gitlab-runner unable to pull repos (host not found)

I’ve set up a new gitlab-runner on my homelab GitLab server. It’s using a Docker executer, and when it attempts to pull the repo to build, it’s gets error:

Could not resolve host: gitlab.local (Domain name not found)

gitlab.local is in /etc/hosts on the VM and I can ping the name and it resolves. A quick Google found this post, and the suggestion is to edit /etc/gitlab-runner/config.toml and add:

network_mode = "host"

to the [runners.docker] section. Seems like that fixes the issue.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.