Windows 容器基本问题 - 始终需要基础映像?

Windows Containers Fundamental Question - Base Image Always Required?

说到容器,我完全是个新手。

我对进程隔离(不是 Hyper-V 隔离)中的 Windows 容器 运行 特别感兴趣

我一直在阅读和观看视频,但有一个基本问题在我迄今为止所做的阅读中尚未向我解释。

每个 Windows Container/Image 是否必须包含 nanoserver 或 servercore 的基础 image/layer?

让我感到困惑的是以下视频中在 5 分钟 35 秒 时发表的评论;

Windows Container 101 Video on Channel9

他发表声明(我在解释)

"that the only thing necessary to build a docker image is a statically linked binary."

这对我来说意味着如果我的主机操作系统 运行 容器具有所有必要的依赖项,那么就可以从基本操作系统虚拟化内核,从而否定对基本操作系统的要求image/layer 在 docker 图片中。

我错过了什么?为什么我需要 nanoserver 或 servercore 基础图像层?

如果我的主机操作系统是 v1903,并且 docker 映像需要 v1903 内核,为什么它不能从主机操作系统虚拟化内核?

提前致谢!

docker的基本思路是复用host系统的内核,windows容器见this

Windows Server containers provide application isolation through process and namespace isolation technology, which is why these containers are also referred to as process-isolated containers. A Windows Server container shares a kernel with the container host and all containers running on the host. These process-isolated containers don't provide a hostile security boundary and shouldn't be used to isolate untrusted code. Because of the shared kernel space, these containers require the same kernel version and configuration.

但是如您所知,要制作 os 运行,仅内核是不够的,您需要文件系统。

所以,这是基础镜像的根,见this

文件系统由一系列层构成,这使您可以os将一些层分离到一个图像,同时将其他层分离到另一个图像。使用基本映像,即此处 nanoserver or servercore,不同的应用程序可以重复使用相同的基本映像,并仅将应用程序二进制文件构建在基本映像上。

如下图所示:不同的容器有自己的二进制文件可以共享基础镜像(这里以ubuntu15.04为例),每个容器的镜像加上共享的公共镜像就可以成为一个完整的文件系统来制作容器运行.