• Register
0 votes
348 views

Problem :

I installed the docker-machine 0.1.0 and docker-compose 1.1.0 on the Mac OS 10.8.5.
Docker-machine is running normally and able to connect by the docker-machine ssh.

But can't connect from docker-compose getting following error:

$ docker-compose up
Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Why can't I connect? Any clues?

7 5 2
3,870 points

1 Answer

0 votes

Solution :

By default a docker daemon always runs as a root user, so you need to prepend sudo to the Docker command(s).

If you don’t want to use the sudo when you use a docker command, create the Unix group called docker and add the users to it. When a docker daemon starts, it makes a ownership of a Unix socket read/writable by a docker group.

To create a docker group and add to your user:

  1. Create a docker group.

          $ sudo groupadd docker

  1. Next add your user to a docker group.

          $ sudo usermod -aG docker $USER

  1. After that log out and log back in so that the group membership is re-evaluated.
  1. Next verify that you can docker commands without sudo.

          $ docker run hello-world

This command downloads the test image and runs it in the container. When a container runs, it prints the informational message and exits.

9 7 4
38,600 points

Related questions

0 votes
2 answers 519 views
519 views
Problem : I have installed docker-machine 0.1.0 and docker-compose 1.1.0 on my Mac OS 10.8.5. My Docker-machine is running normally and it can be connected by docker-machine ssh as follows: $ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM dev * virtualbox ... Dockerfile FROM centos:centos7 DOCKER_HOST tcp://192.168.99.100:2376 docker-compose.yml web: build: . Why can't I connect? Any clues?
asked Nov 24, 2019 alecxe 7.5k points
1 vote
1 answer 94 views
94 views
Problem : Facing the weird following issue cannot connect to the docker daemon at unix:///var/run/docker.sock. is the docker daemon running?
asked Nov 8, 2019 peterlaw 6.9k points
1 vote
1 answer 42 views
42 views
Problem : Encountered bellow docker error cannot connect to the docker daemon at unix:///var/run/docker.sock. is the docker daemon running?
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 53 views
53 views
Problem : After I tried to update my Docker version to 0.8.0, I face an error message while I try to enter sudo docker version as below : Client version: 0.8.0 Go version (client): go1.2 Git commit (client): cc3a8c8 2020 ... 12:55:57 initserver: open /var/lib/docker/aufs/layers/cf2414da53f9bcfaa48bc3d58360d7f1cfd3784e4fe51fbef95197709dfc285d: no such file or directory How can I resolve the issue?
asked Jan 3 alecxe 7.5k points