"Cannot connect to Docker daemon" with docker-executor concurrent jobs using dind

1,243 views
Skip to first unread message

treyd

unread,
Feb 2, 2018, 11:29:46 AM2/2/18
to GitLab
Hello all,

I am trying to get a docker-executor based runner to run multiple CI/CD jobs in parallel (either same project or shared among multiple projects), and I'm running into an issue where the second job is not able to start after the first one has started, and is failing with the following message:

Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image docker:dind ID=sha256:4a2625517421ec21f13a0c31683ab1cc6ac259974be47ba7f2f86cb0c7a9a714 for docker service...
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I am using the 'docker-in-docker' as a service so I can have access to the 'docker' command in my job.  I have 'concurrency' set to 4 in my config.toml:

concurrent = 4
check_interval = 0

[[runners]]
  name = "Gitlab Runner 01"
  token = "1234567890abcdef1234567890"
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "docker:latest"
    privileged = true
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
  [runners.cache]

Is there some limitation on how many simultaneous 'docker' commands can be running at once?  Or, is my runner incorrectly configured?

Appreciate any help in advance.

treyd

cc

unread,
Apr 20, 2018, 5:41:22 PM4/20/18
to GitLab
i think try specifying limit = 1
Limit how many jobs can be handled concurrently by this token. 0 (default) simply means don't limit
Reply all
Reply to author
Forward
0 new messages