本文介绍了如何运行"docker-machine create"在OS X中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I started Docker and am now following the tutorial, but for all I know I couldn't run the docker-machine command on OS X.

文档指出,您运行以下命令创建本地虚拟机:

The documentation states that you run the following command to create a local virtual machine:

docker-machine create --driver virtualbox manager

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

However, this command doesn't work in OS X (11.6), with the following error:

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

我尝试安装virtualbox;但是,另一页明确指出了不要将其安装在本地计算机上:

I tried to install the virtualbox; however, another page clearly states that you must not install it on your local machine:

注意:如果您的系统不满足这些要求,则可以安装使用Oracle VirtualBox而不是HyperKit的Docker Toolbox.

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

所以我只安装了 Mac版Docker ,而不是virtualbox.那我在这里想念什么? 示例页面说,您可以在OS上运行该教程X,所以我想知道如何继续...

So I only installed Docker for Mac and not virtualbox. So what am I missing here? The example page says you can run the tutorial on OS X, so I wonder how I can proceed...

推荐答案

我今天遇到了相同的问题,并在安装Docker for Mac之后通过额外的步骤安装VirtualBox来解决了这个问题(我使用brew cask install virtualbox做到了)

I had the same issue today and resolved it by installing VirtualBox as an additional step after installing Docker for Mac (I did so with brew cask install virtualbox)

我不记得以前必须进行额外的安装,但是也许由于其他工具(例如Vagrant)我已经安装了VirtualBox.无论如何,这在 Docker Machine 文档中进行了解释:

I don't recall having to do the extra install previously, but maybe I already had VirtualBox already installed because of another tool (like Vagrant). Anyway, this is explained in the Docker Machine documentation:

适用于Mac的Docker使用HyperKit,这是轻量级的macOS虚拟化 在macOS 10.10的Hypervisor.framework之上构建的解决方案 优胜美地及更高.

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

当前,没有用于HyperKit的docker-machine create驱动程序,因此 您将使用virtualbox驱动程序创建本地计算机. (请参阅 适用于Oracle VirtualBox的Docker Machine驱动程序.)请注意,您可以运行 HyperKit和Oracle VirtualBox都在同一系统上.了解更多, 请参阅适用于Mac的Docker和Docker Toolbox.

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.

  • 确保已在系统上正确安装了最新的VirtualBox(作为早期Toolbox安装或手动安装的一部分) 安装).
  • Make sure you have the latest VirtualBox correctly installed on your system (either as part of an earlier Toolbox install, or manual install).

这篇关于如何运行"docker-machine create"在OS X中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 12:19