in

Why local Gitlab runner isn’t detecting running Docker instance?


I’ve just installed Gitlab-runner locally on my Ubuntu machine so I can debug my pipeline without using shared runners.

I’m getting this error output:

$ docker-compose up -d --build
Couldn't connect to Docker daemon at http://docker:2375 - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
ERROR: Failed to cleanup volumes
ERROR: Job failed: exit code 1

FATAL: exit code 1

when I run docker --version I get:
Docker version 20.10.12, build e91ed57

and when I run sudo systemctl status docker I get:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-01-01 20:26:25 GMT; 37min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 1404 (dockerd)
      Tasks: 20
     Memory: 112.0M
     CGroup: /system.slice/docker.service
             └─1404 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

so it is installed and running hence the error output is confusing.

Here’s my pipeline:

image: docker:stable

services:
  - docker:dind

stages:
  - build
  - test

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .npm
    - cache/Cypress
    - node_modules

before_script:
    - export REACT_APP_USERS_SERVICE_URL=http://127.0.0.1

job:
  stage: build
  script:
    - apk add --update --no-cache gcc g++ make python2 python2-dev py-pip python3-dev docker-compose
    - docker-compose up -d --build
    - docker logs testdriven_e2e:latest -f

after_script:
    - docker-compose down

I start the running executing sudo gitlab-runner exec docker --docker-privileged job

Any suggestion as to why the runner is complaining about Docker not running ?



Source: https://stackoverflow.com/questions/70551885/why-local-gitlab-runner-isnt-detecting-running-docker-instance

Android Studio Task failed with an exception

A mini app demo that gets data from JSONPlaceholder