Docker主机操作系统和容器基础映像OS之间的关系是什么? [英] What is the relationship between the docker host OS and the container base image OS?

查看:192
本文介绍了Docker主机操作系统和容器基础映像OS之间的关系是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我在问正确的问题,但是当我看到所有docker,我可以得到我的手,我看到我可以在Ubuntu 12.04上安装Docker(例如),然后我可以安装一个Fedora容器或不同版本的ubuntu? (有一个例子,用户在容器中安装了busybox。)

I'm not certain that I'm asking the right question... but while I have been reading everything docker that I can get my hands on I see that I can install Docker on Ubuntu 12.04 (for example) and then I can install a Fedora container or a different version of ubuntu? (there is an example where the user installed busybox in the container.)

当然我可能完全错了。

但是,我的期望是基础系统和容器之间存在短暂的联系。

But it would be my expectation that there was a ephemeral connection between the base system and the container.

重述:主机操作系统和容器基础映像的操作系统?

restated: what is the relationship between the host OS and the container base image's OS?

推荐答案

如BraveNewCurrency所述,主机操作系统和容器之间的唯一关系是内核。

As mentioned by BraveNewCurrency, the only relationship between the host OS and the container is the Kernel.

它是Docker和常规虚拟机之间的主要区别之一,没有开销,一切都直接发生在主机的内核中。

It is one of the main difference between docker and 'regular' virtual machines, there is no overhead, everything takes place directly within the host's kernel.

这就是为什么您只能在容器内运行基于Linux的分发/二进制文件。如果你想要运行别的东西,这并不是不可能的,但你需要在容器内部进行某种虚拟化(qemu,kvm等)。

This is why you can run only Linux based distribution/binaries within the container. If you want to run something else, it is not impossible, but you would need some kind of virtualization within the container (qemu, kvm, etc.)

Docker管理图像那就是文件系统表示。您可以安装任何linux发行版或简单地放入二进制文件。

Docker manage images that are the file system representation. You can install any linux distribution or simply put binaries.

的确,为了方便起见,我们经常依靠基本图片,但您也可以创建图像没有任何分发库/二进制文件。这样一来,您将拥有一个非常小巧但功能强大的容器。

Indeed, for the convenience of the example, we often rely on the base images, but you could also create your image without any of the distribution libraries/binaries. That way you would have a really tiny yet functional container.

有关发行版的另外一点:由于内核仍然是主机的内核,您将不会有任何内容由分发提供的特定内核模块/补丁。

One more point regarding the distributions: as the kernel is still the kernel of the host, you will not have any specific kernel module/patches provided by the distribution.

这篇关于Docker主机操作系统和容器基础映像OS之间的关系是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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