Docker in docker service broken
I read all the issues, but nothing helped me.
Summary
CI job uses docker:dind image as a service for a specific build. However, in execution I get the error
Steps to reproduce
.gitlab-ci.yml
image: tmaier/docker-compose:latest
services:
- docker:18.09.7-dind
variables:
DOCKER_DRIVER: overlay2
stages:
- test
- build
- push
- clean-up
before_script:
- docker info
- apk update
- apk add make
- make down
test:
stage: test
tags: [test]
image: tiangolo/docker-with-compose:latest
script:
- make prod-up
- make composer-init-dev
- make test
build:
stage: build
script:
- docker build -t $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:${CI_COMMIT_REF_NAME}_web-stack -f ./app/web-stack.prod.docker ./app
push:
stage: push
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
script:
- docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:${CI_COMMIT_REF_NAME}_web-stack
clean-up:
stage: clean-up
script:
- make down
when: always
Actual behavior
docker:dind service fails to start
Running with gitlab-runner 12.6.0 (ac8e767a)
on My Docker Runner FRft8kuk
Using Docker executor with image tiangolo/docker-with-compose:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:66dc2d45749a48592f4348fb3d567bdd65c9dbd5402a413b6d169619e32f6bd2 for docker:dind ...
Waiting for services to be up and running...
Pulling docker image tiangolo/docker-with-compose:latest ...
Using docker image sha256:376b83c9b8a8b8972aafc9f7d4d7f29a8c6464bd201e7e826eb4c39fb52f2818 for tiangolo/docker-with-compose:latest ...
Running on runner-FRft8kuk-project-11-concurrent-0 via srv-w-gitrun01...
$ git config --global http.sslVerify false
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/###/docker.###/.git/
From https://gitlab.###/yellowteam/docker.###
* [new ref] refs/pipelines/636 -> refs/pipelines/636
6a063e5..1341d9d master -> origin/master
Checking out 1341d9d4 as master...
Skipping Git submodules setup
$ docker info
Client:
Debug Mode: false
Server:
ERROR: Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
errors pretty printing info
ERROR: Job failed: exit code 1
Expected behavior
Test, build and push
Environment description
sudo docker info
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 55
Server Version: 18.09.1
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 1.0.0~rc6+dfsg1-3
init version: v0.18.0 (expected: fec3683b971d9c3ef73f284f176672c44b448662)
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.19.0-6-amd64
Operating System: Debian GNU/Linux 10 (buster)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.947GiB
Name: srv-w-gitrun01
ID: 3RLU:EW67:4GFN:3MMD:47EA:A2YI:622C:6ZHB:3IFW:LVOA:H747:3ZHY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
config.toml contents
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "My Docker Runner"
url = "https://###/"
token = "FRft8kukkz3qwXw6kkFJ"
executor = "docker"
pre_clone_script = "git config --global http.sslVerify false"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "tiangolo/docker-with-compose"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
Insecure = false
[runners.cache.s3]
[runners.cache.gcs]
Used GitLab Runner version
Version: 12.6.0
Git revision: ac8e767a
Git branch: 12-6-stable
GO version: go1.13.4
Built: 2019-12-22T11:55:34+0000
OS/Arch: linux/amd64
Edited by NikiVe