使用boot2docker无法在os X上运行docker [英] Can't run docker on os X with boot2docker
问题描述
我试图用这个手册。
我删除了virtualbox。然后尝试安装boot2docker。
And I removed virtualbox. And then tried to install boot2docker.
boot2docker init etc(通过docker站点上的手册)
After boot2docker init etc (by the manual on docker site)
docker运行helloworld
docker run helloworld
给我这个错误
无法连接到Docker守护程序。 'docker -d'在这个
主机上运行?
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
boot2docker status
running
docker version
Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): darwin/amd64
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
推荐答案
Boot2docker不是推荐使用Docker的方法Windows / OS X)(IMHO)。
Boot2docker is not the recommended way of using Docker (on Windows/OS X) anymore (IMHO).
请参阅 Docker Machine (可以在内部使用boot2docker iso,但不仅可以使用)。
See Docker Machine instead (which can use the "boot2docker iso" internally, but not only).
您可能还想导入现有的boot2docker环境(保留您的图像等),它是可能也是。
You may also want to import your existing boot2docker environment (to keep your built images, etc.), it's possible too.
然后使用Docker Machine,您可以使用以下命令创建一个工作的Docker环境:
Then using Docker Machine, you can create a working Docker environment with the following commands:
在OS X上(或支持 eval
和导出
命令的操作系统),如果您有 Docker CLI
安装:
On OS X (or an OS which supports eval
and export
commands), if you have the Docker CLI
installed:
docker-machine create -d virtualbox dev
eval "$(docker-machine env dev)"
docker run hello-world
或
在任何操作系统中,如果您有不已安装 Docker CLI
:
On any OS, if you have not the Docker CLI
installed:
docker-machine create -d virtualbox dev
docker-machine ssh dev
docker run hello-world
这篇关于使用boot2docker无法在os X上运行docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!