Docker Desktop如何在Windows计算机上运行linux容器 [英] How docker desktop runs linux containers on Windows machine

查看:586
本文介绍了Docker Desktop如何在Windows计算机上运行linux容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在Windows 10笔记本电脑上安装了Docker for Windows。现在,由于有了这个 Windows Docker,我也可以在Windows 10笔记本电脑上运行Linux容器。如何使其成为可能?我有一些疑问,我在这里遗漏了什么吗?

I have installed Docker for Windows on my Windows 10 laptop. Now because of this "Docker for Windows" I can run Linux containers too on my windows 10 Laptop. How is it made possible? I have some queries, am I missing something here?

查看图像以获得更好的可见性

See image for better visibility

1)我的Windows 10计算机具有Windows内核。

1) My machine which is Windows 10 has Windows Kernel. Right?

2)当我选择运行Linux容器的选项时,我认为Linux VM在Windows 10计算机的顶部运行,并且Linux容器在跑。

2) When I select option to RUN Linux containers, I think a Linux VM is run on top of my Windows 10 machine and on top of that Linux Containers are run. Is that correct?

3)如果Linux VM在使用其内核的Windows计算机的TOP上运行? Linux VM内核还是Windows 10内核?

3) If a Linux VM is run on TOP of Windows machine, whose kernel is used? Linux VM kernel or windows 10 kernel?

4)然后我们怎么说容器不包括操作系统,对于Windows,它们正在运行Linux VM。

4) And then how can we say containers doesn't include operating system, for windows they are running a Linux VM.

5)现在,如果我运行第二个容器,它将在已经运行的Linux VM之上运行还是会再次启动新的Linux VM?我认为它将在同一运行的Linux VM上运行,但要求不要造成任何混乱。

5) Now if I run a second container, will it run on top of the already running Linux VM or will it launch a new linux VM again? I think it will run on the same running linux VM but asking so that there isn't any confusion.

6)如果Linux VM在Windows计算机的TOP上运行,那么我们是否可以像运行Linux VM的版本那样对Linux VM进行任何控制,或者它始终相同,而我们对此没有任何控制?

6) If a Linux VM is run on TOP of Windows machine, then do we have any control on the Linux VM being run like version of Linux VM, etc or it's always the same and we don't have any control over it?

7)如果Linux VM在Windows机器上运行,那么Windows资源对Linux VM以及容器都不可见?如果可见,那么Linux VM如何与Windows Host通信?

7) If a Linux VM is run on top of Windows machine, then is the windows resources not visible to the Linux VM and hence to the container? If it's visible then how can Linux VM talk to Windows Host?

推荐答案

1)我的Windows 10计算机具有Windows内核。是吗?

1) My machine which is Windows 10 has Windows Kernel. Right?

A:是的。

2)当我选择运行Linux容器的选项时,我认为Linux VM在Windows 10计算机上运行,​​并且在Linux容器上运行。

2) When I select option to RUN Linux containers, I think a Linux VM is run on top of my Windows 10 machine and on top of that Linux Containers are run. Is that correct?

A:是的。

3)如果Linux VM在TOP的TOP上运行,则可以在Hyper-v管理器中看到名为mobylinux的hyper-v linux虚拟机。 Windows计算机,使用的是谁的内核?是Linux虚拟机内核还是Windows 10内核?

3) If a Linux VM is run on TOP of Windows machine, whose kernel is used? Linux VM kernel or windows 10 kernel?

A:hyper-v vm使用Linux内核。

A: The hyper-v vm use linux kernel.

4 )然后我们怎么说容器不包括操作系统,对于Windows,它们正在运行Linux VM。

4) And then how can we say containers doesn't include operating system, for windows they are running a Linux VM.

A:不知道从哪里获得信息。 docker映像仅具有文件系统,例如ubuntu16.04文件系统,但没有内核。当容器运行时,它将使用image&的文件系统。共享主机的内核(也许您只是说它没有自己的内核,所以您称它没有操作系统?)

A: Not sure where you get information. The docker image only has file system, e.g. ubuntu16.04 filesystem, but do not have kernel. When container run, it will use the filesystem of image & share the kernel of host(Maybe you just mean it not have own kernel, so you call it not have operation system?)

5)现在,如果我运行另一个容器,它将在已经运行的Linux VM之上运行还是会再次启动新的Linux VM?我认为它可以在同一运行的Linux VM上运行,但是请确保没有任何混乱。

5) Now if I run a second container, will it run on top of the already running Linux VM or will it launch a new linux VM again? I think it will run on the same running linux VM but asking so that there isn't any confusion.

A:是的,它将再次在同一Linux vm上运行

A: Yes, it will run on the same linux vm again.

6)如果Linux VM在Windows计算机的TOP上运行,那么我们对Linux VM的运行是否有任何控制权,例如Linux VM的版本等?总是一样,我们对此没有任何控制权?

6) If a Linux VM is run on TOP of Windows machine, then do we have any control on the Linux VM being run like version of Linux VM, etc or it's always the same and we don't have any control over it?

A:不,请参见此讨论,似乎无法ssh到vm,只是一些解决方法来访问文件系统

A: No, see this discussion, seems cannot ssh to the vm, just some workaround to access the filesystem of the vm, so not find any way to change the kernel or linux distribution.

7)如果Linux VM在Windows计算机上运行,​​则Windows资源是Windows虚拟机。对Linux VM不可见,因此对容器不可见?如果可见,那么Linux VM如何与Windows Host通信?

7) If a Linux VM is run on top of Windows machine, then is the windows resources not visible to the Linux VM and hence to the container? If it's visible then how can Linux VM talk to Windows Host?

A:理论上,您可以将Windows文件夹安装到linux vm,然后容器可以使用linux文件夹与音量。 Windows的docker为您完成了此任务,右键单击任务栏中的图标,您会看到如下所示的内容,就像图片一样:

A: In theory, you can mount the windows folder to linux vm, then container can use the linux folder with volume. And docker for windows have done this for you, right click the icon in your taskbar, you could see something like follows, just do like the picture:

这篇关于Docker Desktop如何在Windows计算机上运行linux容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆