[gitlab] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
1 min readOct 18, 2018
I want build my docker images through GitLab CI/CD. When the GitLab Runner tried to exec docker build process. I encountered problem:
...
$ docker build -t XXXXXXXX/test-build-docker:latest .
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ERROR: Job failed: exit code 1
According the answer of @conconbug at this post https://gitlab.com/gitlab-org/gitlab-runner/issues/1986 & https://gitlab.com/gitlab-org/gitlab-runner/issues/2408.
...[[runners]]
...
[runners.docker]
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
...
This will fix this problem.