0

I am recently working on GitLab CI/CD and I want to set up a runner on digital ocean droplet however I get the following error:

$ docker network create web
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1

how should I avoid this problem, consider that the docker is up and running on the droplet ubuntu with 8 GB ram

smrf
  • 349
  • 3
  • 16
  • What executor are you using for the runner? If you're using a docker executor, then the problem is your _job_ container doesn't have access to the docker daemon. – sytech Apr 17 '22 at 19:45
  • I think the problem is with the executor I have changed the executor to shell executor and it works, however why docker executor does not work on the server ? @sytech – smrf Apr 18 '22 at 04:49
  • Gotcha. Thanks for confirming that. I'll provide an answer soon that explains this behavior and provides a solution to successfully use the docker executor (which works out better for build isolation) – sytech Apr 19 '22 at 04:41

1 Answers1

0

it can be only one of this reason:

a) gitlab-runner user is not in docker group

id gitlab-runner

should show something like

uid=998(gitlab-runner) gid=998(gitlab-runner) groups=998(gitlab-runner),1001(docker)

b) docker service is not running in droplet

David
  • 302
  • 1
  • 4