Hello,
I have a K8S-cluster deployed in my own environment and I also have a GitLab instance deployed by Helm. Everything works fine, but I have a problem with the Auto DevOps feature. I created a very simple repository that consists of a Dockerfile only. Enabled Auto DevOps and configured access the K8S-cluster. When I make a commit, GitLab runs a pipeline and it fails on the Build stage. I’m getting the following message:
Waiting for pod gitlab-managed-apps/runner-p2gzyjzv-project-5-concurrent-0xv86w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-p2gzyjzv-project-5-concurrent-0xv86w to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-p2gzyjzv-project-5-concurrent-0xv86w to be running, status is Pending
Running on runner-p2gzyjzv-project-5-concurrent-0xv86w via runner-gitlab-runner-78556ccbdd-27n8n...
Initialized empty Git repository in /builds/bitrix-test/spring-test/.git/
Fetching changes with git depth set to 50...
Created fresh repository.
From https://gitlab.k8s-test.uplink.ua/bitrix-test/spring-test
* [new branch] master -> origin/master
Checking out bcdfbfd5 as master...
Skipping Git submodules setup
$ [[ "$TRACE" ]] && set -x # collapsed multi-line command
$ if [[ -z "$CI_COMMIT_TAG" ]]; then # collapsed multi-line command
$ /build/build.sh
Logging to GitLab Container Registry with CI credentials...
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
Building Dockerfile-based application...
time="2019-07-14T16:10:28Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial tcp 127.0.0.1:2375: connect: connection refused"
context canceled
ERROR: Job failed: command terminated with exit code 1
As I understand, the runner tries to run Docker to build an image, but the runner works in a pod of the K8S cluster and Docker isn’t accessible here. What should I do to make it working?
Thanks in advance!