docker/compose in the private runner cant connect to the docket daemon
Trying to launch docker compose but getting an error below. It is interesting that docker login works, but docker compose and even docker build . doesn't.
Running with gitlab-runner 14.7.0 (__)
on gitlab-portal-gitlab-runner-d_f-aser eawsf
Preparing the "kubernetes" executor 00:00
Using Kubernetes namespace: gitlab-portal
Using Kubernetes executor with image docker/compose:latest ...
Using attach strategy to execute scripts...
Preparing environment
Waiting for pod gitlab-portal/runner-asefr-project-asef-concurrent-asef to be running, status is Pending
Waiting for pod gitlab-portal/runner-asef-project-eafs-concurrent-wer to be running, status is Pending
ContainersNotReady: "containers with unready status: [build helper svc-0]"
ContainersNotReady: "containers with unready status: [build helper svc-0]"
Running on runner-xaasfeef5c-project-asefe-concurrent-asef via gitlab-portal-gitlab-runner-awef-jasf...
Getting source from Git repository 00:01
Fetching changes with git depth set to 20...
Initialized empty Git repository in /my_repo
Created fresh repository.
Checking out easef1c as development...
Skipping Git submodules setup
Executing "step_script" stage of the job script 00:02
$ apk add ca-certificates
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/1) Installing ca-certificates (20191127-r2)
Executing busybox-1.31.1-r9.trigger
Executing ca-certificates-20191127-r2.trigger
OK: 6 MiB in 15 packages
$ docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $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 run --privileged private_registry_name/repo_name:latest
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
Cleaning up project directory and file based variables 00:00
ERROR: Job failed: command terminated with exit code 125
gitlab_ci.yml
stages:
- test
api_test_job:
stage: test
image: docker/compose:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
script:
- apk add ca-certificates
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker run --privileged private_registry_name/repo_name:latest
Edited by Ramazan Safiullin