terraform-aws-gitlab-runner
terraform-aws-gitlab-runner copied to clipboard
Allow setting runners.docker.services in toml
I've been trying to find a way to configure a docker mirror in the docker+machine runners, but had some problems. I have set runners_docker_registry_mirror
- If I set
runners_add_dind_volumes, then a job script ofdocker infoshows theRegistry Mirrors, but this conflicts with services in jobs such as the auto-devopscode_qualityjob, which also try to mountvar/run/docker.sock. - If I don't set
runners_add_dind_volumes(using insteadrunners_additional_volumesto mount all but the docker.sock) then the services start correctly, butdocker infodoesn't show the mirror.
I think I have a workaround though, in which I start a docker service in the runner by modifying the config.toml
I have a requirement that users can use auto-devops without modification, so simply modifying the service(s) in the pipeline config is not an option.
Have I missed a trick, or is adding [[runners.docker.services]] a sensible approach? If so, I'll raise a PR to allow this.
See also this issue for more background: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27173
@npalm I'm working on a PR for this. Will be pretty basic initially, but will work for the docker mirror use case
If I understand you correctly, @jonmcewen, the problem is, that the mirror disappears if runners_additional_volumes is used? Using runners_add_dind_volumes everything is fine.
Another question which came into my mind: Why is a job trying to mount a docker.sock? Do you have a link to the mentioned code_qualityjob?
If I understand you correctly, @jonmcewen, the problem is, that the mirror disappears if
runners_additional_volumesis used? Usingrunners_add_dind_volumeseverything is fine.Another question which came into my mind: Why is a job trying to mount a
docker.sock? Do you have a link to the mentionedcode_qualityjob?
Please see the first comment on this issue: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4260
Rest assured I spent many days going round in circles on this issue. I stand behind my solution until a better one is proposed.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.
Guess this wasn't closed then #491 was merged months ago.