Docker

Docker和VM

今天刚好去docker官网浏览了一下,所以记个笔记,以下为官网原文,然后是我的翻译(个人理解)。

Docker is a platform for developers and sysadmins to  build, share, and run applications with containers. The use of containers to deploy applications is called containerization. Containers are not new, but their use for easily deploying applications is.

Containerization is increasingly popular because containers are:

  • Flexible: Even the most complex applications can be containerized.
  • Lightweight: Containers leverage and share the host kernel, making them much more efficient in terms of system resources than virtual machines.
  • Portable: You can build locally, deploy to the cloud, and run anywhere.
  • Loosely coupled: Containers are highly self sufficient and encapsulated, allowing you to replace or upgrade one without disrupting others.
  • Scalable: You can increase and automatically distribute container replicas across a datacenter.
  • Secure: Containers apply aggressive constraints and isolations to processes without any configuration required on the part of the user.

docker的优势:

  • 灵活: 即使是最复杂的应用程序也可以被封装。
  • 轻量级: 容器利用和共享主机内核,使它们在系统资源方面比虚拟机更高效。
  • 可移植性: 可以在本地构建、部署到云,并在任何地方运行。
  • 松耦合: 容器是高度自给自足和封装的,允许您替换或升级一个容器而不破坏其他容器。
  • 可伸缩: 您可以增加并自动跨数据中心分发容器副本。
  • 安全: 容器对进程应用主动约束和隔离,而不需要用户进行任何配置。

A container runs natively on Linux and shares the kernel of the host machine with other containers. It runs a discrete process, taking no more memory than any other executable, making it lightweight.

By contrast, a virtual machine (VM) runs a full-blown “guest” operating system with virtual access to host resources through a hypervisor. In general, VMs incur a lot of overhead beyond what is being consumed by your application logic.

容器在Linux上本地运行,并与其他容器共享主机的内核。它运行一个独立的进程,不占用比其他任何可执行程序更多的内存,使其轻量级

相比之下,虚拟机(VM)运行一个全部的“guest”操作系统,通过虚拟机监控程序对主机资源进行虚拟访问。通常,vm会产生大量开销,超出应用程序逻辑所消耗的开销。

Container stack example

发表评论