Allow overriding DOCKER_DRIVER in Auto DevOps Template
Summary
The current implicit CI configuration for Auto DevOps sets the variable DOCKER_DRIVER
to overlay2
, which is a sane choice for many environments. There is no documented way (and I cannot think of any undocumented one) to override this and in our environment it fails, since we need to use the zfs
driver.
Steps to reproduce
- use
docker
withzfs
driver - configure
gitlab-runner
with docker or kubernetes executor targeting the zfs docker - watch how everything using
docker:dind
in an Auto DevOps pipeline fails- docker:dind does not start successfully
Example Project
We use 11.4.5 locally and I do not think an example project would add more information here.
What is the current bug behavior?
The variable DOCKER_DRIVER
is set to a static value and cannot be overriden.
What is the expected correct behavior?
The variable DOCKER_DRIVER
is set to a sane default (overlay2
) and there is a documented way to override it per instance or, even better, per gitlab-runner
.
Relevant logs and/or screenshots
Output of a failing job
Running with gitlab-runner 11.4.2 (cf91d5e1)
on Kubernetes Runner a2ef97b9
Using Kubernetes namespace: gitlab-runner
Using Kubernetes executor with image docker:stable-git ...
Waiting for pod gitlab-runner/runner-a2ef97b9-project-287-concurrent-0w6ftj to be running, status is Pending
Waiting for pod gitlab-runner/runner-a2ef97b9-project-287-concurrent-0w6ftj to be running, status is Pending
Waiting for pod gitlab-runner/runner-a2ef97b9-project-287-concurrent-0w6ftj to be running, status is Pending
Waiting for pod gitlab-runner/runner-a2ef97b9-project-287-concurrent-0w6ftj to be running, status is Pending
Running on runner-a2ef97b9-project-287-concurrent-0w6ftj via gitlab-runner-6b5cb48957-n7db5...
Cloning repository...
Cloning into '/mgr/deobfuscate-ws'...
Checking out 3b31e02a as master...
Skipping Git submodules setup
$ # Auto DevOps variables and functions # collapsed multi-line command
$ setup_docker
$ build
Logging to GitLab Container Registry with CI credentials...
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?
ERROR: Job failed: command terminated with exit code 1
Output of checks
Results of GitLab environment info
# gitlab-rake gitlab:env:info
System information
System: Debian 9.5
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.4.5p335
Gem Version: 2.7.6
Bundler Version:1.16.2
Rake Version: 12.3.1
Redis Version: 3.2.12
Git Version: 2.18.1
Sidekiq Version:5.2.1
Go Version: go1.7.4 linux/amd64
GitLab information
Version: 11.4.5-ee
Revision: bf6db46
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.8
URL: https://gitlab.autinity.de
HTTP Clone URL: https://gitlab.autinity.de/some-group/some-project.git
SSH Clone URL: git@gitlab:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: yes
Using Omniauth: yes
Omniauth Providers: autinity, github
GitLab Shell
Version: 8.3.3
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
Possible fixes
Line of code causing the issue: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml#L55
I don't know what the best fix would be. Only idea I have is renaming the variable to DOCKER_DRIVER_DEFAULT
at that line and checking in every job if DOCKER_DRIVER
is set and when it isn't, set it to DOCKER_DRIVER_DEFAULT
.