Docker Community Forums

Share and learn in the Docker community.

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is docker daemon running

I’m using Jenkins on Docker on my local Mac Machine. And I’m running another Docker on ubuntu VirtualBox. So now, there are 2 docker machines. one is on my mac machine and one is on my Ubuntu VirtualBox machine. I’m running Jenkins on Mac Docker. Now in the Jenkins pipeline, I want to build an image on my ubuntu machine. I’ve configured Jenkins docker cloud and in the docker host URL, it is connected to the ubuntu docker-machine. But while building a new image, I’m getting the error. Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I’ve tried even adding ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock at /lib/systemd/system/docker.service

Can someone help me out? Help is appreciated.