Skip to content

Providing proxy settings to dockerd strated with dind service

Is there a way to pass proxy settings to the dockerd that gets started when gitlab runner executes a job that has dind specified as a service?

The proxy I need to pass needs no authentication so I followed these instructions except CNTLM:

https://docs.gitlab.com/runner/configuration/proxy.html#adding-the-proxy-to-the-docker-containers

#1537 (comment 19443090)

https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-executor

and got nearly all to work by using docker-socket-binding

https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-socket-binding

except for passing a volume containing test files to docker with -v GL-CI log, which seems only possible with dind.

Currently I am facing the problem that I cannot successfully run a job for a .gitlab-ci.yml that uses dind as a service (to have docker -v). Even though the container of the docker executor of the runner seems to get the proxy settings (git clone works), docker login/pull/push seem not to get out GL-CI log. As far as I understand the settings for docker from

https://docs.gitlab.com/runner/configuration/proxy.html#configuring-docker-for-downloading-images

only have effect on the host dockerd but not on the dockerd run inside dind. Since dockerd seems to take the proxy settings from the environment variables (HTTP_PROXY and HTTPS_PROXY) I wonder if it would be sufficient to pass those values set in the config.toml on to the docker command of the gitlab runner that starts the dind service (e.g. with --env).

Is that already possible or would that need some changes in gitlab runner?

Are the --env settings of the gitlab runner also used when starting the dind service, i.e. passed on to the environment in which dockerd is started?

Edited by Roman Grothausmann