DinD - Cannot connect to the Docker daemon. Is the docker daemon running on this host?
NOTE: The official documentation for this topic is updated at https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-workflow-with-docker-executor. Consider taking a look there as well.
I'm trying to get the docker in docker build to work. But every time I end up with Cannot connect to the Docker daemon. Is the docker daemon running on this host?
. I did also try the gitlab/dind:latest.
Do I miss anything? Thanks in advance.
config.toml
oncurrent = 1
check_interval = 0
[[runners]]
name = "##########"
url = "##########"
token = "##########"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:latest"
privileged = true
disable_cache = false
volumes = ["/cache"]
[runners.cache]
.gitlab-ci.yml
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
services:
- docker:dind
before_script:
- docker info
build:
script:
- docker build -t bla/bla .
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- docker push
Output:
Running with gitlab-ci-multi-runner 1.8.1 (a2efdd4)
Using Docker executor with image docker:latest ...
Pulling docker image docker:dind ...
Starting service docker:dind ...
Waiting for services to be up and running...
Using locally found image version with exactly the same ID
Pulling docker image docker:latest ...
Running on runner-714b8171-project-45-concurrent-0 via v22014031196817311...
Fetching changes...
HEAD is now at e523e0c Update .gitlab-ci.yml
From #####
e523e0c..48c7bfb master -> origin/master
Checking out 48c7bfb8 as master...
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
ERROR: Build failed: exit code 1
Output with gitlab/dind:latest
Running with gitlab-ci-multi-runner 1.8.1 (a2efdd4)
Using Docker executor with image gitlab/dind:latest ...
Using locally found image version with exactly the same ID
Pulling docker image gitlab/dind:latest ...
Running on runner-714b8171-project-45-concurrent-0 via v22014031196817311...
Fetching changes...
HEAD is now at e523e0c Update .gitlab-ci.yml
Checking out e523e0c7 as master...
ln: failed to create symbolic link '/sys/fs/cgroup/systemd/name=systemd': Operation not permitted
Timed out trying to connect to internal docker host.
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
ln: failed to create symbolic link '/sys/fs/cgroup/systemd/name=systemd': Operation not permitted
Timed out trying to connect to internal docker host.
ERROR: Build failed: exit code 1
Edited by Jason Yavorska