Add a hosts-line on docker guests (for runner)

Even though it makes very little sense to me some of my colleagues found that their tests works better if the docker guests the runner gives them, has an entry in /etc/hosts for our a specific host (actually our on-premise gitlab server, but I guess that’s not important).
That can be achieved by putting extra_hosts = ["gitlab...:<ip>"] in the [runners.docker] section of that particular runner in /etc/gitlab-runner/config.toml.

It makes very little sense (to me, the guys who found out, and everybody else in the company I’ve talked with about it - we have very stable DNS service), but it’s very little work and a big improvement.

The same image is used for other things, so it makes very little sense to include that line in the image.

Now I’m trying to automate the creation of that runner, and everything else that needs to be set for that runner can be put on the command line to gitlab-runner register..., but how do get that added?

1 Like