【问题标题】:How does Docker for Windows run Linux containers?Docker for Windows 如何运行 Linux 容器?
【发布时间】:2017-05-23 20:58:36
【问题描述】:

在旧版本的 Docker for Windows 中,我记得它明确表示它使用 linux VM 作为内核。

但是自从新的稳定版本(我认为是 2016 年 7 月发布)以来,它说

Docker for Windows is a native Windows application with a native user interface and auto-update capability, deeply integrated with Windows native virtualization, Hyper-V, networking and file system

如果我理解正确的话,指定的基本映像是用于用户空间的,并且使用了主机的内核。 那么,如果我指定使用 ubuntu 基础镜像来运行 echo 命令,那么 Windows 内核是如何发挥作用的呢?

还是我完全误解了什么?

【问题讨论】:

  • 这个 Docker for Windows 只运行 Windows 容器
  • 测试版可以在 Windows 和 Linux 容器之间切换。它在稳定版本中尚不可用。 docs.docker.com/docker-for-windows/#/…
  • 那么,为什么我可以用最新的稳定版运行docker run ubuntu /bin/echo 'Hello world' 命令?
  • 我可以向您介绍其中一位架构师的演示文稿:Linux Containers on Windows -- The Inside Story,John Starks,DockerCon Europe 2017。

标签: windows docker kernel


【解决方案1】:

Docker for Windows 仍然使用 Linux VM 来运行 Linux 容器。但是,Linux VM 不是使用 Virtual Box(与 Docker Toolbox 一起使用的),而是使用 Hyper-V(Windows 原生虚拟机管理程序)运行。这意味着 Docker for Windows 交付的组件更少,移动部件更少。

如果您安装 Docker for Windows 并运行 docker version,您将看到 Docker Linux 守护程序正在“Moby Linux”上运行。

【讨论】:

  • 从 DockerConf 2017 开始,有一些关于利用 Windows 10 的功能来托管 Linux 子系统的新公告,因此您可能不需要在 HyperV 中运行 Windows 的 Linux VM 的完整 Docker
猜你喜欢
  • 1970-01-01
  • 2017-02-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-02-28
  • 1970-01-01
  • 2020-10-02
  • 2018-04-09
相关资源
最近更新 更多