问题
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/orDOCKER_CERT_PATH
; and/orDOCKER_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