且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Docker如何使用不同的内核运行发行版?

更新时间:2023-09-17 15:53:46

泊坞窗如何在Debian主机上运行,​​也许可以在容器中运行OpenSUSE

How can docker run on a Debian host maybe an OpenSUSE in a container

因为内核是相同的,并且将支持Docker引擎来运行所有这些容器映像:主机内核应为3.10或更高版本,但其

Because the kernel is the same and will support the Docker engine to run all those container images: the host kernel should be 3.10 or more, but its list of system calls is fairly stable.

请参见"架构容器:为什么要了解用户空间与内核空间的重要性":

  1. 应用程序包含业务逻辑,但依赖于系统调用.
  2. 编译应用程序后,应用程序使用(即依赖)的一组系统调用将嵌入二进制文件中(在高级语言中,这是解释器或JVM).
  3. 容器并不需要抽象用户空间和内核空间来共享一组通用的系统调用.
  4. 在容器化的世界中,此用户空间被捆绑并运送到不同的主机,从笔记本电脑到生产服务器.
  5. 在未来几年中,这将带来挑战.
  1. Applications contain business logic, but rely on system calls.
  2. Once an application is compiled, the set of system calls that an application uses (i.e. relies upon) is embedded in the binary (in higher level languages, this is the interpreter or JVM).
  3. Containers don’t abstract the need for the user space and kernel space to share a common set of system calls.
  4. In a containerized world, this user space is bundled up and shipped around to different hosts, ranging from laptops to production servers.
  5. Over the coming years, this will create challenges.

有时会添加新的系统调用,而不推荐使用旧的系统调用;在考虑容器基础结构以及将在其中运行的应用程序的生命周期时,应该考虑到这一点.

From time to time new system calls are added, and old system calls are deprecated; this should be considered when thinking about the lifecycle of your container infrastructure and the applications that will run within it.

另请参阅"为什么使用内核版本与Docker容器中的Ubuntu版本不匹配?:

容器内没有内核.即使您安装了内核,在容器启动时也不会加载该内核.容器的真正目的是在不需要运行新内核的情况下隔离进程.

There's no kernel inside a container. Even if you install a kernel, it won't be loaded when the container starts. The very purpose of a container is to isolate processes without the need to run a new kernel.