Docker如何共享资源 [英] How does Docker share resources

查看:219
本文介绍了Docker如何共享资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在看Docker,我从这篇文章运行多个docker容器的意思是快速的,因为它们通过LXC主机共享内核级资源,但是,我还没有找到关于这种关系如何工作的文档,码头配置,以及资源共享级别。

I've been looking into Docker and I understand from this post that running multiple docker containers is meant to be fast because they share kernel level resources through the "LXC Host," however, I haven't found any documentation about how this relationship works that is specific to the docker configuration, and at what level are resources shared.

Docker映像和Docker容器涉及共享资源以及共享资源的方式是什么?

What's the involvement of the Docker image and the Docker container with shared resources and how are resources shared?

编辑:

当谈到资源共享的内核时,哪个内核是这样的?它是指主机O.S(Docker二进制程序居住的级别)还是引用容器基于的映像的内核?不是基于不同linux发行版的容器是否需要运行在不同类型的内核上?

When talking about "the kernel" where resources are shared, which kernel is this? Does it refer to the host O.S (the level at which the docker binary lives) or does it refer to the kernel of the image the container is based on? Won't containers based on different linux distributions need to run on different types of kernels?

编辑2:

一个最后的编辑使我的问题更清楚一点,我很好奇Docker是否真的不运行图像的完整操作系统,因为他们建议在这个页面上,如何Docker不同于VM

One final edit to make my question a little more clear, I'm curious as to whether or not docker really does not run the full O.S of the image as they suggest on this page under the "How is Docker different then a VM"

以下语句似乎与图表相矛盾以上,取自:

The following statement seems to contradict the diagram above, taken from here:


容器由操作系统,用户添加文件和
元数据组成。正如我们所看到的,每个容器都是从一个图像构建的。

A container consists of an operating system, user-added files, and meta-data. As we've seen, each container is built from an image.


推荐答案

不再需要使用LXC,用户工具。它仍然使用与他们的内部容器库libcontainer相同的底层技术。实际上Docker可以使用各种系统工具来实现进程和内核之间的抽象:
$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $非linux操作系统。主机和容器的内核是相同的,但它支持一种上下文意识来将它们彼此分离。

Strictly speaking Docker no longer has to use LXC, the user tools. It does still use the same underlying technologies with their in house container library, libcontainer. Actually Docker can use various system tools for the abstraction between process and kernel: The kernel need not be different for different distributions - but you cannot run a non-linux OS. The kernel of the host and of the containers is the same but it supports a sort of context awareness to separate these from one another.

每个容器都包含一个单独的操作系统超越了内核。它有自己的用户空间应用程序/库,并且对于所有意图和目的,它的行为就好像它有自己的内核。

Each container does contain a separate OS in every way beyond the kernel. It has its own user-space applications / libraries and for all intents and purposes it behaves as though it has its own kernel.

这篇关于Docker如何共享资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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