• Register
0 votes
738 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

Please log in or register to answer this question.

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 809 views
809 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
0 votes
1 answer 5 views
5 views
Problem: Please help me > Couldn't connect to docker daemon at http+docker://localhost?
asked 6 days ago Rada Gracelynn 7.3k points
0 votes
2 answers 7 views
7 views
Problem: I am stuck during learning as I have already mentioned in my question someone please cooperate me to continue my project-Thanks
asked Mar 27 ashik 14.6k points
0 votes
1 answer 4 views
4 views
Problem: I have applied every solution available on internet but still I cannot run Docker. I want to use Scrapy Splash on my server. Here is history of commands I ran. docker run -p 8050:8050 scrapinghub/splash sudo docker run -p 8050:8050 scrapinghub/splash sudo usermod -aG docker $(whoami) sudo ... 0.0 0.0 17200 964 pts/1 S 17:06 0:00 newgrp docker root 30221 0.0 0.0 17200 964 pts/1 S 17:0
asked Apr 24 sumaiya simi 43.9k points
1 vote
1 answer 195 views
195 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 194 views
194 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
1 vote
1 answer 1.8K views
1.8K views
Problem : Currently I am learning Docker. Recently I came across below Docker error in one of the projects: “Invalid reference format: repository name must be lowercase” I am trying to understand the causes of this message and way to fix above error message. Can someone guide me in solving above error message?
asked Mar 28, 2020 morrisBson 3.2k points
0 votes
1 answer 7 views
7 views
Problem: After I update my Docker version to 0.8.0, I get an error message while entering sudo docker version, I got this: 2014/02/19 12:54:16 Can't connect to docker daemon. Is 'docker -d' running on this host? How do I solve the problem?
asked Apr 24 ummeshani 10.8k points
1 vote
1 answer 21 views
21 views
Problem : I am trying to add one manager in Docker swarm. But it is showing me the below error. Cannot connect to the Docker daemon. Is the docker daemon running on this host? Any ideas on what I need to do to fix this? Thanks!
asked Mar 31 Sabbir Hossain 14.6k points