Setting DOCKER_HOST after Docker Toolbox/Mac install

限于喜欢 提交于 2019-12-05 02:06:31

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/32699709/setting-docker-host-after-docker-toolbox-mac-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!