Docker 如何运行不同内核的发行版? [英] How can Docker run distros with different kernels?

查看:34
本文介绍了Docker 如何运行不同内核的发行版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

docker 如何在 Debian 主机或容器中的 OpenSUSE 上运行?它使用不同的内核,具有分离的模块.较旧的 Debian 版本也使用较旧的内核,那么如何在内核版本 3.10+ 上运行它?较旧的内核只有较旧的内置功能,旧发行版如何管理新功能?其中的诀窍"是什么?

解决方案

docker 如何在 Debian 主机或容器中的 OpenSUSE 上运行

因为内核是一样的,并且会支持 Docker 引擎来运行所有这些容器镜像:主机内核应该是 3.10 或更高,但它的

<块引用>

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

另见为什么是内核版本与 Docker 容器中的 Ubuntu 版本不匹配?":

<块引用>

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

How can docker run on a Debian host maybe an OpenSUSE in a container? It uses different kernel, with separated modules. Also older Debian versions have used older kernels, so how can run it on a kernel version 3.10+ ? Older kernels have only older built in functions, how can an old distro manage new features? What is "the trick" in it?

解决方案

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

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.

See "Architecting Containers: Why Understanding User Space vs. Kernel Space Matters":

  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.

See also "Why kernel version doesn't match Ubuntu version in a Docker container?":

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.

这篇关于Docker 如何运行不同内核的发行版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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