简体   繁体   English

如何在 Windows 上初始化和运行 Docker?

[英]How to initialize and run Docker on windows?

I have Docker installed on Windows 7 platform.我在 Windows 7 平台上安装了 Docker。 However when I try to run boot2docker start, the console gives me:但是,当我尝试运行 boot2docker start 时,控制台给了我:

Failed to get machine 'boot2docker-vm': machine does not exist.无法获取机器“boot2docker-vm”:机器不存在。

Ok, so I try to initialize the machine: boot2docker init.好的,所以我尝试初始化机器:boot2docker init。 What now happens is even though I have the ISO image on the same path as docker, it tries to download a new image (and then fails to do so).现在发生的情况是,即使我的 ISO 映像与 docker 位于同一路径上,它也会尝试下载新映像(然后失败)。

I uninstalled both OracleVM and GIT before installing them with boot2docker bundle as advised on Docker forums, but now I don't know how to proceed.我按照 Docker 论坛上的建议卸载了 OracleVM 和 GIT,然后使用 boot2docker bundle 安装它们,但现在我不知道如何继续。

I had the same problem on a Windows 7 64 bit system when I installed the entire boot2docker package.当我安装整个 boot2docker 包时,我在 Windows 7 64 位系统上遇到了同样的问题。 It seems that running the solely 64-bit based boot2docker image from a 32-bit OS image (eg created by Virtualbox) does not work.从 32 位操作系统映像(例如由 Virtualbox 创建)运行仅基于 64 位的 boot2docker 映像似乎不起作用。

The solution for me was我的解决方案是

  1. to activate Intel Virtualisation Technolologies in my BIOS (Lenovo X61 for me).在我的 BIOS 中激活英特尔虚拟化技术(对我来说是联想 X61)。 Note that the settings can be found either under CPU or Security.请注意,可以在 CPU 或安全性下找到这些设置。

  2. choose a 64 bit OS version in VirtualBox and boot in with the image obtained by boot2docker.在 VirtualBox 中选择 64 位操作系统版本并使用 boot2docker 获得的映像启动。

In case you're trying to do this now如果您现在尝试这样做

  1. For Windows 10 64-bit: Pro, Enterprise, or Education (Build 15063 or later), follow the instructions to install Docker Desktop here https://docs.docker.com/docker-for-windows/install/ .对于 Windows 10 64 位:专业版、企业版或教育版(Build 15063 或更高版本),请按照此处的说明安装 Docker 桌面https://docs.docker.com/docker-for-windows/install/

  2. If you have Windows systems that do not meet the requirements of Docker Desktop for Windows(in my case Microsoft Windows 10 Home Single Language), you can install Docker Toolbox by following the instructions here https://docs.docker.com/toolbox/toolbox_install_windows/ .如果您的 Windows 系统不符合 Docker Desktop for Windows 的要求(在我的情况下为 Microsoft Windows 10 Home Single Language),您可以按照此处的说明安装 Docker Toolbox https://docs.docker.com/toolbox/ toolbox_install_windows/

boot2docker does not support sharing directories on Windows IIRC. boot2docker 不支持在 Windows IIRC 上共享目录。 The way I run Docker on windows is:我在 Windows 上运行 Docker 的方式是:

  • install VirtualBox安装 VirtualBox
  • install Vagrant安装流浪汉
  • create a directory (let's say c:\\vm\\docker )创建一个目录(比方说c:\\vm\\docker
  • download this Vagrantfile and save it under c:\\vm\\docker\\Vagrantfile下载这个Vagrantfile并将其保存在c:\\vm\\docker\\Vagrantfile
  • open a DOS command prompt打开 DOS 命令提示符
  • go to the directory cd c:\\vm\\docker转到目录cd c:\\vm\\docker
  • start the VM vagrant up and wait for it to install, start up and get provisionned启动 VM vagrant up并等待它安装、启动并进行配置
  • connect to the VM vagrant ssh连接到 VM vagrant ssh
  • play with docker docker images , etc使用 docker docker images

Also you might want a real console instead of using the DOS command prompt:此外,您可能需要一个真正的控制台,而不是使用 DOS 命令提示符:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM