官术网_书友最值得收藏!

What is a container?

A container image is a lightweight, standalone, executable package that also encapsulates everything that is needed to run it. This would include code, the runtime, system tools, system libraries, and settings.

This definition comes from the website of Docker, which of course is a market-leading container firm. Consider a number of containers running on top of the same OS kernel. Each one of these containers will then, effectively, have its own little environment and executable files, as well as the entire runtime set up. Each one of these containers can be created by using a software such as Docker. Docker can be thought of as a kind of CD tool that takes in your code and outputs a container that can be carried around and run in its own little sandbox. Containers differ from VMs in some important ways, but the basic idea is fairly similar. Inpidual containers are often in the Docker file format.

In the case of containers, right below our inpidual containers lies Docker, which, as we know, is an open platform that allows folks to build and run distributed applications in the form of containers. The crucial bit though, is that Docker runs on top of the host OS, which means that each inpidual container does not abstract the OS. In contrast, in the case of VMs, we can see that each VM has its applications, libraries, and a guest OS. Beneath each of the VMs lies the VM monitor, or hypervisor as it is known. This is a piece of software that should be created by a company such as VMware for instance, which ensures that one or more VMs are able to run on the host machine and interact with the hardware and the other infrastructure:

In effect, containers add one further level of indirection to your code. This makes them different from VMs because we virtualize the OS. For instance, in the previous block diagram, Docker was acting as a proxy between the container and the OS.

In a VM, on the other hand, every VM has its own OS that talks to the hypervisor and that hypervisor VM monitor is, in effect, virtualizing or abstracting the hardware. Now it's pretty clear that a VM needs to lug around its OS within it, which makes it a little less portable and a little bigger in size and slower to boot. In general, a virtual machine is definitely more heavyweight than a Docker container, because a VM contains the whole OS (including kernel) while the containers only contain an abstraction of the OS (while using shared kernel). For those of you who are not familiar with containers in general.

You can visit this link from official Docker website: https://www.docker.com/what-docker

Hence, VMs tend to be an order or several orders of magnitude bigger than containers and they are also slower to deploy and get started with. Here is a quick comparison between the two–GCE and GKE.

GCE instances are VMs, like those on the right. GKE clusters host containers, like those on the left. This is an important distinction:

主站蜘蛛池模板: 鄂托克旗| 四平市| 闸北区| 嫩江县| 安丘市| 克什克腾旗| 剑川县| 金山区| 高台县| 大渡口区| 突泉县| 曲松县| 克什克腾旗| 昌平区| 定边县| 德阳市| 千阳县| 牟定县| 卫辉市| 吉水县| 喀喇沁旗| 台安县| 平果县| 汉寿县| 郯城县| 视频| 合作市| 上饶市| 凤冈县| 成安县| 北安市| 高邮市| 同心县| 于都县| 宁远县| 邻水| 东平县| 武汉市| 阳东县| 会理县| 建湖县|