Skip to content

Autoconfigure DOCKER_HOST=tcp://localhost:2375 for dind in privileged mode?

I copied this issue from https://gitlab.com/charts/charts.gitlab.io/issues/31 after that monorepo was split. The issue seems to be still there.

Hi folks, a helm chart newbie here!

I just tried linking my GitLab CE instance to an experimental k8s runner that uses your helm chart. My docker builds inside CI jobs were failing in the beginning, but eventually it just turned out that I did not read the docs carefully. The solution was to set DOCKER_HOST=tcp://localhost:2375 as recommended here: https://docs.gitlab.com/runner/executors/kubernetes.html#using-docker-dind. Going to the project's CI config and manually adding this variable helped!

I'm starting this issue as I don't find my solution ideal – it requires to re-visit every project I have and either manually specify a variable in the CI/CD tab or update every .gitlab-ci.yml, which looks even worse! Either way, the change makes the existing builds kubernetes-specific and this means that I can't easily switch back to a standard runner or combine different types of runners.

It'd be great if DOCKER_HOST=tcp://localhost:2375 was configured by the helm chart or somewhere else under the hood, so that the existing pipelines could migrate to a new executer without any changes. Does this look possible?

PS: We've got 100+ GitLab projects at work, many of which produce docker images. While I can imagine setting DOCKER_HOST=tcp://localhost:2375 for every project on my personal GitLab instance if I decide to fully switch to a k8s runner, the same process at work would be insane! At the moment we just use a small GitHost runner there.

Edited by Alexander Kachkaev