简体   繁体   English

Docker for Windows如何运行Linux容器?

[英]How does Docker for Windows run Linux containers?

In the old versions of Docker for Windows, I remember it explicitly said it used a linux VM for the kernel. 在旧版本的Docker for Windows中,我记得它明确表示它使用Linux VM作为内核。

But since the new stable version (released in July 2016 I think), it says 但是,自从新的稳定版本(我想在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

If I understand correctly, the specified base image is for the user space and the host's kernel is used. 如果我理解正确,则指定的基本映像用于用户空间并使用主机的内核。 So, if I specify that I'm using an ubuntu base image to run the echo command, how does the Windows kernel come into play? 因此,如果我指定我使用ubuntu基本映像来运行echo命令,那么Windows内核如何发挥作用?

Or am I completely misunderstanding something? 还是我完全误解了什么?

Docker for Windows still uses a Linux VM to run Linux containers. Docker for Windows仍然使用Linux VM来运行Linux容器。 But instead of using Virtual Box (which is what is used with Docker Toolbox), the Linux VM is run using Hyper-V - a Windows-native hypervisor. 但是,不使用Virtual Box(与Docker Toolbox一起使用),而是使用Hyper-V(一种Windows本机虚拟机管理程序)运行Linux VM。 This means that Docker for Windows ships fewer components and has less moving parts. 这意味着Docker for Windows可以运送更少的组件并且移动部件更少。

If you install Docker for Windows and run docker version you'll see that the Docker Linux daemon is running on "Moby Linux". 如果您安装Docker for Windows并运行docker version您将看到Docker Linux守护程序正在“Moby Linux”上运行。

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

相关问题 In Docker Desktop for windows 10 with WSL2, where does docker containers live & how Linux containers can run a java app, but not windows nanoserver? - In Docker Desktop for windows 10 with WSL2, where does docker containers live & how Linux containers can run a java app, but not windows nanoserver? 如何在Docker Windows中编辑Linux容器配置并观察其哈希值? - How to edit Linux containers configs and observe it hashes in Docker Windows? 如何在 docker windows 容器中运行 GUI file.exe? - How to run the GUI file.exe in docker windows containers? 如何在Windows上的Docker上运行Linux库? - How to run Linux libraries on Docker on Windows? 如何在 linux 主机上运行 windows docker 容器? - How to run a windows docker container on linux host? 参考 Windows 容器的名称来自 Docker 桌面中的 Linux 容器 - Reference Windows containers by name from Linux containers in Docker Desktop Windows容器在docker上的运行速度非常慢 - Very slow RUN on docker on windows containers 如何在Docker Hub中过滤基于Windows或Linux的容器? - How can I filter on Windows-based or Linux-based containers within Docker Hub? 如何访问在Windows OS的Docker工具箱Linux容器中创建的项目目录? - How can I access the project directories that are created in the Docker toolbox Linux containers on my Windows OS? 如何在 Windows 11 中的 linux 20.04 中运行 Docker - How can run Docker in linux 20.04 in Windows 11
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM