We have an on-prem GitLab instance (version 15.2).
I've set up a runner which runs in a Docker container (which shouldn't make any difference actually), and configured it to use a Docker executor.
Now I've set up a CI pipeline which uses this runner, and it is using it. The problem is, that when I run a build, I get:
The build for some reason cannot clone the repository from GitLab because it cannot resolve the hostname of the server.
When running any container on this machine, it can happily resolve this hostname. Also, when running a build with:
variables:
GIT_STRATEGY: none
script: nslookup <url of the server>
I get a response.
I read in the docs, in https://docs.gitlab.com/runner/executors/docker.html#workflow that when a build with Docker executor runs, it performs a pre-job step, which runs in a "special docker image" which does the git clone.
But I can't understand - why this special container can't resolve the hostname of the GitLab instance?