带有 docker 部署 Windows 容器的 Linux 机器 [英] Linux machine with docker deploy windows container

查看:36
本文介绍了带有 docker 部署 Windows 容器的 Linux 机器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台装有 docker 主机的 16GB 内存的 Linux 服务器.我想在它上面部署一个 Windows Server 容器.是否可以?有人刚刚尝试过这个解决方案吗?

I have a Linux server with 16GB ram with docker host installed. I would like to deploy on it a Windows Server container. Is it possible? Anyone has just tried this solution?

推荐答案

2019 年更新

duct_tape_coder评论:

Microsoft 改进了容器的网络选项并且现在允许每个 Pod 有多个容器并具有改进的命名空间.

Microsoft has improved the network options for containers and now allows multiple containers per pod with improved namespace.

<小时>

理论上(2015 年 10 月的原始答案):

Linux 主机上没有运行Windows 容器".
Linux 容器不会直接在 Windows 服务器上运行,因为它依赖于对 Linux 内核的系统调用.


In theory (original answer Oct 2015):

There is no "Windows container" running on a Linux host.
And a Linux container would not run directly on a Windows server, since it relies on system calls to a Linux kernel.

您当然可以通过 VM 在任何 Windows 机器上运行这些 Linux 容器.
这就是 docker 工具箱将要安装的.

You certainly can run those Linux containers on any Windows machine through a VM.
That is what docker toolbox will install.

很快就会有 支持 Windows 上的 docker,但这适用于 Windows 容器,而不是 Linux 容器.

There will be support for docker on Windows soon, but that would be for Windows container, not Linux containers.

2017 年更新:是的,LinuxKit 允许通过从 构建的最小 Linux 操作系统,在 Windows 平台上通过 Hyper-V 隔离包装器运行 linux 容器linuxkit.
这仍然是相同的想法:Linux 在 Windows 上的 VM 中运行.
那不是部署在 Windows 服务器上的 Linux 服务器:仅部署在运行在 Windows 上的 VM 中的 Linux 服务器内.

Update 2017: yes, LinuxKit allows to run a linux container through aa Hyper-V isolation wrapper on a Windows platform, through a minimal Linux OS built from linuxkit.
That is still the same idea: linux running inside a VM on Windows.
That is not a Linux server deployed on a Windows server: only deployed inside a Linux server running in a VM on Windows.

参见Linux和 Windows,生活在一起,完全混乱!(好吧,Kubernetes 1.5)"

Kubernetes 1.5 包括对 Windows Server Containers(一种类似于 Docker 的共享内核模型)和 Hyper-V Containers(一种为多租户环境提供更好隔离的单内核模型)的 alpha 支持(以更大的延迟为代价).
最终结果是能够创建单个 Kubernetes 集群,该集群不仅包括运行 Linux 容器的 Linux 节点或运行 Windows 容器的 Windows 节点,还包括并排,以获得真正的混合体验.
例如,单个服务可以拥有使用 Windows Server 容器的 POD 和使用 Linux 容器的其他 POD.

Kubernetes 1.5 includes alpha support for both Windows Server Containers, a shared kernel model similar to Docker, and Hyper-V Containers, a single-kernel model that provides better isolation for multi-tenant environments (at the cost of greater latency).
The end result is the ability to create a single Kubernetes cluster that includes not just Linux nodes running Linux containers or Windows nodes running Windows containers, but both side by side, for a truly hybrid experience.
For example, a single service can have PODs using Windows Server Containers and other PODs using Linux containers.

但是:

虽然它看起来功能齐全,但在这个早期版本中确实存在一些限制,包括:

Though it appears fully functional, there do appear to be some limitations in this early release, including:

  • 由于编写方式的依赖性,Kubernetes 主节点仍必须在 Linux 上运行.可以移植到 Windows,但目前团队认为最好将精力集中在客户端组件上.
  • Windows 中没有对容器网络覆盖的原生支持,因此网络仅限于 L3.(还有其他解决方案,但它们本身并不可用.)
    不过,Kubernetes Windows SIG 正在与 Microsoft 合作解决这些问题,他们希望在明年初发布 Kubernetes 1.6 时取得进展.
  • Windows 容器之间的网络更加复杂,因为每个容器都有自己的网络命名空间,因此建议您暂时使用单容器 Pod.
  • 在 Windows Server 容器中运行的应用程序可以以 Windows 支持的任何语言运行.您可以在 Linux 容器中运行 .NET 应用程序,但前提是它们是用 .NET Core 编写的.Nano Server 操作系统也支持 .NET core,可以部署在 Windows Server Containers 上.
  • The Kubernetes master must still run on Linux due to dependencies in how it’s written. It’s possible to port to Windows, but for the moment the team feels it’s better to focus their efforts on the client components.
  • There is no native support for network overlays for containers in windows, so networking is limited to L3. (There are other solutions, but they’re not natively available.)
    The Kubernetes Windows SIG is working with Microsoft to solve these problems, however, and they hope to have made progress by Kubernetes 1.6’s release early next year.
  • Networking between Windows containers is more complicated because each container gets its own network namespace, so it’s recommended that you use single-container pods for now.
  • Applications running in Windows Server Containers can run in any language supported by Windows. You CAN run .NET applications in Linux containers, but only if they’re written in .NET Core. .NET core is also supported by the Nano Server operating system, which can be deployed on Windows Server Containers.

这篇关于带有 docker 部署 Windows 容器的 Linux 机器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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