Couldn't connect to Docker daemon at http+docker://localunixsocket

docker

#1

After enabling Docker Layer Caching on my account, all builds using “machine” executor fail with the following error:

Couldn’t connect to Docker daemon at http+docker://localunixsocket - is it running?
If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Is this a known error? How to fix it?


#2

I don’t know if it applies in your case, but the common reason for this is that the user you’re trying to execute a docker command with does not have permission to access the daemon. The simplest way to give it permission is to add that user to the docker group, so check what groups your user is a member of.


#3

I’m also currently getting this message. Looking through a docker thread I tried adding the following commands to my config file in an attempt to add the user to the docker group as halfer suggested:

      - run: sudo groupadd docker
      - run: sudo usermod -aG docker root
      - run: sudo service docker restart

But that resulted in docker: unrecognized service


#4

That’s rather odd. Try sudo service --status-all to see whether Docker is called something else, or whether the service is not installed for some reason.


#5

Where in the build is it failing? If you’re trying to execute a docker command from within a docker container, the socket must be exposed to the container.


#6

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.