加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows容器可以在Linux上托管吗?

发布时间:2020-12-13 20:37:28 所属栏目:Windows 来源:网络整理
导读:这可以在Linux上运行Windows Containers吗?该场景基于.NET(旧网)编写的解决方案以及希望使用Docker运行此解决方案以在localhost上提供net462编写API的Linux用户. 我正在使用Docker for windows的测试版 如果没有,那么为什么Windows可以运行linux容器而不是
这可以在Linux上运行Windows Containers吗?该场景基于.NET(旧网)编写的解决方案以及希望使用Docker运行此解决方案以在localhost上提供net462编写API的Linux用户.

我正在使用Docker for windows的测试版

如果没有,那么为什么Windows可以运行linux容器而不是反之亦然?

编辑:

一段时间过去了,这个问题很受欢迎.我想在此添加一条说明,解决方法是使用新的netstandard.它允许我将4.6.2框架打包到新库中.

更新于2018年:

原始答案一般是正确的,但几个月前,docker增加了experimental feature LCOW(official github repository).

从this post:

Doesn’t Docker for Windows already run Linux containers? That’s right.
Docker for Windows can run Linux or Windows containers,with support
for Linux containers via a Hyper-V Moby Linux VM (as of Docker for
Windows 17.10 this VM is based on LinuxKit).

The setup for running Linux containers with LCOW is a lot simpler than
the previous architecture
where a Hyper-V Linux VM runs a Linux Docker
daemon,along with all your containers. With LCOW,the Docker daemon
runs as a Windows process (same as when running Docker Windows
containers),and every time you start a Linux container Docker
launches a minimal Hyper-V hypervisor running a VM with a Linux
kernel,runc and the container processes running on top.

Because there’s only one Docker daemon,and because that daemon now
runs on Windows,it will soon be possible to run Windows and Linux
Docker containers side-by-side,in the same networking namespace
. This
will unlock a lot of exciting development and production scenarios for
Docker users on Windows.

原版的:

正如@PanagiotisKanavos的评论中所提到的,容器不是用于虚拟化,而是使用主机的资源.因此,目前windows容器无法在linux机器上“按原样”运行.

但是 – 你可以通过使用VM来实现 – 因为它适用于Windows.您可以在Linux主机上安装Windows VM,这将允许运行Windows容器.

有了它,恕我直言在PROD环境中以这种方式运行它将不是最好的主意.

此外,this answer提供了更多详细信息.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读