7

I ran docker images and got the following error:

FATA[0000] Get http:///var/run/docker.sock/v1.17/images/json:
dial unix /var/run/docker.sock: no such file or directory.
Are you trying to connect to a TLS-enabled daemon without TLS?

There seems to be no useful message on how to fix the error. What could be wrong?

Pranjal Mittal
  • 10,772
  • 18
  • 74
  • 99
  • 1
    The Docker daemon isn't running. – Adrian Mouat Apr 12 '15 at 21:28
  • 1
    Take a look at this question: [Am I trying to connect to a TLS-enabled daemon without TLS?](http://stackoverflow.com/questions/27528337/am-i-trying-to-connect-to-a-tls-enabled-daemon-without-tls) – wypieprz Apr 12 '15 at 21:32
  • Oh; I am using docker on mac and starting docker is really confusing. When I type `docker` it shows me the help, so I thought it was running. – Pranjal Mittal Apr 12 '15 at 22:04

3 Answers3

9

https://docs.docker.com/installation/mac/

you need to do this once:

boot2docker init

then, everytime you reboot your mac you will need to run :

boot2docker start

That is the command that starts the docker daemon. But, on each shell you want to access it from you will need to run:

$(boot2docker shellinit)

Now you can use the docker client, like:

docker run hello-world
hiroshi
  • 6,871
  • 3
  • 46
  • 59
Greg
  • 6,571
  • 2
  • 27
  • 39
  • I think we need to `boot2docker ssh` as well? Because docker run hello-world still does not run on my mac (Same TLS error). When I sshed and ran docker search, it worked pretty well. – Pranjal Mittal Apr 12 '15 at 23:18
  • 2
    hmmm. i ran these commands on my mac and they worked. you *must* run $(boot2docker shellinit) after you init and start docker. When I skip that step I get the TLS error. If you run boot2docker without the leading $( and the trailing ) it won't work. Maybe that's the problem? – Greg Apr 13 '15 at 00:03
  • Oh I ran it without the $(..) so maybe it didn't work earlier. I used `eval "$(boot2docker shellinit)"` as it was in the docs and it worked. I don't have to use `boot2docker ssh` now before. – Pranjal Mittal Apr 13 '15 at 00:08
3

Your docker daemon is simply not running.

Just run service docker start

Tristan Foureur
  • 1,647
  • 10
  • 23
0

It may be not a bug. I am facing the same log when run :"boot2docker up -v" command. Then 'eval "$(boot2docker shellinit)" ' just doesn't work on fish but the "boot2docker shellinit" is actually the fish command. Then I switch to zsh, there is some wired output which also has been reported somewhere. Then I switch to bash. I try both 'eval "$(boot2docker shellinit)" ' and "$(boot2docker shellinit)" without eval. Then I found that "boot2docker shellinit" also generates the fish script. Which may give me the answer why it doesn't work at first place. So I copied the three line of fish script and pasted it in the fish shell and now the error log the one you are facing is going even in the bash. I don't really know the reason. Usually the ev on works on the current shell and current session.

declanqian
  • 1
  • 1
  • 1
  • 2