We are using self hosted Gitlab and Runner and trying to use dind to run CI/CD builds but all my jobs are failing with below error -
Cannot connect to the Docker daemon at tcp://docker:2375/. Is the docker daemon running?
My ci file -
build:
image: docker:18.09
stage: build
services:
- docker:18.09-dind
variables:
# Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
script:
- echo $CI_REGISTRY
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker info
Runner Configuration -
[[runners]]
name = "Docker Runner"
url = "https://gitlab.systems.co.uk/"
token = "fgtgervsdasdsdds"
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
image = "docker:19.03-dind-rootless"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache", "/app/log/docker-rootless/docker.sock:/var/run/docker.sock", "/srv/gitlab-runner/config/certs:/etc/gitlab-runner/certs"]
shm_size = 0
Error output -
$ echo $CI_REGISTRY
registry.gitlab.systems.co.uk
$ docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
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**
$ docker info
Cannot connect to the Docker daemon at tcp://docker:2375/. Is the docker daemon running?
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
If you see above my login is successful to the registry but when i do docker info
it fails.
Any idea and clues what is wrong here?
NOTE - I am using rootless docker because of security concerns