macos - 如何在 OS X 中运行 "docker-machine create"?

标签 macos docker

我启动了 Docker,现在正在学习教程,但据我所知,我无法在 OS X 上运行 docker-machine 命令。

The documentation states运行以下命令来创建本地虚拟机:

docker-machine create --driver virtualbox manager

但是,此命令在 OS X (11.6) 中不起作用,并出现以下错误:

Running pre-create checks...
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"

我尝试安装虚拟机;但是,another page clearly states你不能将它安装在你的本地机器上:

VirtualBox prior to version 4.3.30 must NOT be installed (it is incompatible with Docker for Mac)

Note: If your system does not satisfy these requirements, you can install Docker Toolbox, which uses Oracle VirtualBox instead of HyperKit.

所以我只安装了 Docker for Mac 而没有安装 virtualbox。那么我在这里错过了什么? The example page说你可以在 OS X 上运行教程,所以我想知道我该如何继续......

You can follow along and run this example using Docker for Mac, Docker for Windows or Docker for Linux.

最佳答案

我今天遇到了同样的问题,并通过安装 VirtualBox 作为安装 Docker for Mac 后的附加步骤来解决它(我使用 brew install --cask virtualbox 这样做)

我不记得以前必须进行额外的安装,但也许我已经安装了 VirtualBox,因为另一个工具(如 Vagrant)。无论如何,这在 Docker Machine 中有解释。文档:

If you are using Docker for Mac

Docker for Mac uses HyperKit, a lightweight macOS virtualization solution built on top of the Hypervisor.framework in macOS 10.10 Yosemite and higher.

Currently, there is no docker-machine create driver for HyperKit, so you will use virtualbox driver to create local machines. (See the Docker Machine driver for Oracle VirtualBox.) Note that you can run both HyperKit and Oracle VirtualBox on the same system. To learn more, see Docker for Mac vs. Docker Toolbox.

  • Make sure you have the latest VirtualBox correctly installed on your system (either as part of an earlier Toolbox install, or manual install).

关于macos - 如何在 OS X 中运行 "docker-machine create"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42079458/

相关文章:

macos - 如果有一个冒号( :) in the directory name, 我怎么能把它添加到 $PATH?

macos - 如何配置 git 以继承我特定的 $PATH 环境变量?

macos - 为什么 tmux 在编辑器退出时删除终端内容?

database - 如何通过使用docker在postGIS数据库中修复 “unknown authentication response: 10”

node.js - 如何链接两个docker容器?

docker - 自动化Docker容器的服务(couchbase)配置

linux - 脚本找不到文件

macos - $PATH 中/usr/bin 和/usr/local/bin 等的顺序

Docker 网桥

docker - 使用 ENV 参数设置容器 PATH