Allow passing arguments to Docker in Docker services in Auto DevOps
Several Auto DevOps jobs use Docker in Docker to pull images and run containers. The codeclimate images used in the codequality
job are humongous (codeclimate/codeclimate-duplication#284). With the way Docker in Docker is used, codeclimate images have to be pulled anew on every run of the codequality
job, as an example. For my local CI runners, that's an enormous amount of traffic to support.
It would be helpful if there was a standardized way to pass options like --registry-mirror
to dockerd in Auto DevOps jobs, to leverage registry mirrors that are closer to CI runners.
Here's an example that doesn't use variables. In my case, I have one registry mirror for Docker Hub (registry-1.docker.io) and another mirror for GitLab (registry.gitlab.com). The hostname has been scrubbed.
codequality:
image: docker:stable
services:
- name: docker:stable-dind
command:
- --registry-mirror=https://registry-mirror-here:5000
- --registry-mirror=https://registry-mirror-here:5001
…