Gitlab Runner with Kubernetes executor - Cannot connect to the Docker daemon
Summary
Summarize the bug encountered concisely
Steps to reproduce
How one can reproduce the issue - this is very important
Actual behavior
What actually happens
Expected behavior
I should be able to run a build within a kubernetes cluster.
What you should see instead The executor can't connect to docker. I've tried the default executor and then also to set the docker daemon.
Relevant logs and/or screenshots
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?
image: docker:git
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
before_script:
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
development:
stage: deploy
script:
- docker build -t "$CI_REGISTRY_IMAGE:latest" .
- docker push "$CI_REGISTRY_IMAGE:latest"
only:
- master
testing:
stage: deploy
script:
- docker build -t "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}" .
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}"
only:
- branches
except:
- master
stable:
stage: deploy
script:
- docker build -t "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}" .
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}"
only:
- tags
image: docker:git
services:
- docker:dind
variables:
# DOCKER_DRIVER: overlay
DOCKER_HOST: tcp://localhost:2375
before_script:
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
development:
stage: deploy
script:
- docker build -t "$CI_REGISTRY_IMAGE:latest" .
- docker push "$CI_REGISTRY_IMAGE:latest"
only:
- master
testing:
stage: deploy
script:
- docker build -t "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}" .
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}"
only:
- branches
except:
- master
stable:
stage: deploy
script:
- docker build -t "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}" .
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}"
only:
- tags
I've tried both of these (and various versions in between). None connect.
Environment description
I'm using the Gitlab Runner installed via the helm charts. I've set the executor to Kubernetes, like instructed.
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.6", GitCommit:"7fa1c1756d8bc963f1a389f4a6937dc71f08ada2", GitTreeState:"clean", BuildDate:"2017-06-16T18:34:20Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.6", GitCommit:"7fa1c1756d8bc963f1a389f4a6937dc71f08ada2", GitTreeState:"clean", BuildDate:"2017-06-16T18:21:54Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"}
Are you using shared Runners on GitLab.com? Or is it a custom installation? Which executors are used? Please also provide the versions of related tools like
docker info
if you are using the Docker executor.
Used GitLab Runner version
gitlab-runner --version
Version: 9.3.0
Git revision: 3df822b
Git branch: 9-3-stable
GO version: go1.7.5
Built: Thu, 22 Jun 2017 10:57:22 +0000
OS/Arch: linux/amd64
Please run and paste the output of
gitlab-runner --version
. If you are using a Runner where you don't have access to, please paste at least the first lines the from build log, like:Running with gitlab-ci-multi-runner 1.4.2 (bcc1794) Using Docker executor with image golang:1.8 ...