boot2docker 导致 "Cannot connect to the Docker daemon. Is 'docker -d' running on this host?"

boot2docker resulting in "Cannot connect to the Docker daemon. Is 'docker -d' running on this host?"

我是 docker 的新手,正在尝试 运行 this project OS X 10.10。 Docker 通过 brew 安装并且在基础上看起来不错:

➜  docker-riak git:(develop) docker -v
Docker version 1.6.2, build 7c8fca2
➜  docker-riak git:(develop) boot2docker -v
Boot2Docker-cli version: v1.6.2
Git commit: cb2c3bc

这是错误:

➜  docker-riak git:(develop) DOCKER_RIAK_AUTOMATIC_CLUSTERING=1 DOCKER_RIAK_CLUSTER_SIZE=5 DOCKER_RIAK_BACKEND=leveldb make start-cluster
./bin/start-cluster.sh
time="2015-06-06T11:21:19-04:00" level=fatal msg="Cannot connect to the Docker daemon. Is 'docker -d' running on this host?"

Bringing up cluster nodes:

make: *** [start-cluster] Error 1

我发现 this thread 推荐 sudo docker -d,但这 returns 是一个错误:

➜  docker-riak git:(develop) docker -d
2015/06/06 11:18:21 This is a client-only binary - running the Docker daemon is not supported.

这里需要做什么?

运行 完整的 docker version 命令,您应该会看到如下内容:

$ docker version Client version: 1.6.2 Client API version: 1.18 Go version (client): go1.4.2 Git commit (client): 7c8fca2 OS/Arch (client): darwin/amd64 Server version: 1.6.2 Server API version: 1.18 Go version (server): go1.4.2 Git commit (server): 7c8fca2 OS/Arch (server): linux/amd64

如果您没有看到所有这些,您可能与 boot2docker 的连接有问题。检查您是否添加了正确的导出,如下所示:

export DOCKER_HOST=tcp://192.168.59.103:2376 export DOCKER_CERT_PATH=/Users/<yourusername>/.boot2docker/certs/boot2docker-vm export DOCKER_TLS_VERIFY=1

看看是否有帮助。