3

Mac here. I installed Docker via the Toolbox and all Docker commands yield the same error:

myuser@mymachine:~/tmp$docker info
Get http:///var/run/docker.sock/v1.20/info: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?

myuser@mymachine:~/tmp$sudo docker info
Password:
Get http:///var/run/docker.sock/v1.20/info: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?

Interestingly enough, however:

myuser@mymachine:~/tmp$docker -v
Docker version 1.8.1, build d12ea79

Google results | for this error indicate that the Toolbox did not install correctly, and that one of (or all) of the following env vars need to be set:

  • DOCKER_HOST; and/or
  • DOCKER_CERT_PATH; and/or
  • DOCKER_TLS_VERIFY

I have verified DOCKER_HOST is not set on my machine (neither env nor echo $DOCKER_HOST show it). So my concerns:

  • What are these env vars and what do they do? What are their proper values?
  • How do I permanently set them so that they persist machine restarts?

Update

Running the commands suggested by the one answer so far:

myuser@mymachine:~/tmp$docker-machine start default
Error: Host does not exist: default
myuser@mymachine:~/tmp$eval $(docker-machine env default)
Error: Host does not exist: default

Ideas?

Community
  • 1
  • 1
smeeb
  • 27,777
  • 57
  • 250
  • 447

1 Answers1

5

Run:

$ docker-machine start default
$ eval $(docker-machine env default)

And try again.

Those environment variables point your local Docker client to the Docker engine running in the VM. The above commands will set them appropriately.

Adrian Mouat
  • 44,585
  • 16
  • 110
  • 102
  • Thanks @Adrian Mouat (+1) - are you sure this won't hose my local Vagrant or Vagrant/Docker config? If you get a chance, please have a look at [this GitHub issue](https://github.com/bubenkoff/vagrant-docker-example/issues/5). Essentially I installed Vagrant, then installed Docker, and the Docker toolbox install hosed my Vagrant/VirtualBox installation. I then deleted everything and tried again and am currently able to run the `Vagrantfile` in that project which runs Docker. I'm worried that when I issue the commands you specify above, I'll break something else. Thoughts?!? Thanks again! – smeeb Sep 21 '15 at 16:28
  • 1
    No idea, sorry. It *shouldn't* break things. That doesn't mean it *won't* :) – Adrian Mouat Sep 21 '15 at 17:51
  • 1
    Actually, I don't see how those commands could break anything further than installing Toolbox may have. – Adrian Mouat Sep 21 '15 at 17:53
  • OK thanks for the vote of confidence @Adrian Mouat (+1 both)! However please see my update, running both of those commands produces `Error: Host does not exist: default` error messages...any ideas?!? – smeeb Sep 21 '15 at 18:02
  • 2
    Hmm, that probably is a bug to do with virtualbox. You could run `docker-machine create -d virtualbox default`, but it sounds like something went wrong during the install and running create is probably more dangerous. – Adrian Mouat Sep 21 '15 at 18:36
  • Thanks again @Adrian Mouat (+1) - so I tried your `create` command, and it worked. Then I ran the `eval $(...)` that you suggested above, and that worked. I then ran `docker info` and *that* worked! Can you just confirm that I won't have to do this for each Docker project, or each time I restart my machine? If so, I'll call this *done*! Thanks again!!! – smeeb Sep 21 '15 at 18:43
  • You'll need to run the start command when you reboot and the eval command in each new terminal. I suppose you could add them to a login script if you want.The thing is Toolbox should have run the create command, so there's probably a bug somewhere. – Adrian Mouat Sep 21 '15 at 19:34
  • Does any of this change because of the Docker on Mac being completed? This no longer requires docker machine right? – Nicholas DiPiazza Feb 04 '17 at 14:27
  • Right, Docker for Mac will take care of all this for you. – Adrian Mouat Feb 05 '17 at 16:24