首页 > 解决方案 > 容器如何在 AWS EC2 虚拟化上运行?

问题描述

正如他们所说,容器不在 Hypervisor 层上运行,那么当我们在 AWS EC2 实例上运行 Container 时会发生什么?由于 EC2 本身运行在由 AWS 管理的管理程序层上。

有人可以帮助我更好地理解这一点吗?

谢谢,

标签: amazon-ec2containersruntimehypervisor

解决方案


You probably need to provide more information to back up your question. In the gaps, there are a lot of interpretations for what you are asking, so in a quick return to the basics:

  1. A Hypervisor presents to an Operating System what looks like an independent machine that it can execute on. It might have some weird drivers (aka virtio) but it is just a machine.
  2. A Container presents to a Program what looks like an independent Operating System. It might have some weird IP addresses (127.x.y.z), and stuff, but it looks like it has its own OS.

Note that with [2], the Program can start a whole bunch of other Programs, so as far as it is concerned, it has an entire OS to itself. In reality it is sharing its machine with other Containers, each of which think they have their own machine, and some Root machine which is hosting the Containers.

Containers can host other Containers (well, at least in theory).

Hypervisors can host other Hypervisors (in practise, but your mileage might vary).

So, a Container is an Operating System Instance, running within an Operating System, which might be running within a Virtual Machine on a Hypervisor which is running several Virtual Machines each of which might be running Operating systems which are hosting multiple Containers.

If it strikes you that this is why we can’t have nice things, yes, you are right.


推荐阅读