docker

关注公众号 jb51net

关闭
首页 > 网站技巧 > 服务器 > 云和虚拟化 > docker > docker、LXC、LXD的区别传统虚拟机与操作系统虚拟化

docker、LXC、LXD的区别及传统的虚拟机与操作系统虚拟化详解

作者:enjoy编程

文章对比了Docker、LXC/LXD与传统虚拟机的区别,Docker为应用级容器,轻量快速,跨平台部署;LXC提供系统级虚拟化,基于Linux内核,但管理复杂;LXD作为LXC升级,支持快照迁移等高级功能,采用REST API,传统虚拟机依赖hypervisor,资源开销大,性能损耗明显

1. 概念解释

1.1. Docker

Docker是一个用于在集中式平台上创建、部署和运行应用程序的开源工具。

这使得主机的操作系统通过容器运行具有相同Linux内核的应用程序,而不是创建一个完整的虚拟机。

使用docker容器不需要考虑Ram和磁盘空间的分配。它能够自己处理这些需求。

Docker只提供了应用程序的虚拟化,通过cgroup、namespace实现资源隔离,资源限制配置参见resource_constraints

Docker容器将应用和其依赖环境全部打包到一个单一对象中,在不包含完整的操作系统的情况下就能运行普通应用,更加轻量级,可移植性更好。所以它成为了PaaS(比如Kubernates)平台的基石

Docker提供的特性:

1.2. LXC

LXC是Linux容器的缩写,Linux容器是一种操作系统,用于通过单个Linux内核在受控主机上虚拟运行多个Linux系统。

LXC与内核的cgroup捆绑在一起,为进程和网络空间提供功能,而不是创建一个完整的虚拟机,并为应用程序提供一个隔离的环境。

LXC代表Linux容器,它是一种用于操作系统虚拟化的工具。通过使用LXC,可以在虚拟环境中而不是在物理系统中操作任何软件或应用程序。虚拟环境功能使LXC更加安全,成本也更低。LXC很容易操作,因为它带有控制组【Control groups Cgroups】功能。

LXC为提供了完整的操作系统虚拟化,

操作系统级虚拟化是一种服务器虚拟化方法,在这种方法中,操作系统的内核允许存在多个孤立且隔离的用户空间实例,而不是只有一个

LCX就是一种轻量级虚拟化,将linux进程沙盒化,使用的是linux中的namespace技术进行资源隔离

LXC提供的特性:

1.3. LXD

LXD代表Linux Daemon,它是一个扩展,主要用于指导LXC。

它用于向LXC提供新的属性和功能,以便以更有效的方式使用LXC。

LXD和LXC之间的通信是通过使用内置库完成的,liblxc就是这样一个库。

2. 区别

2.1. docker与LXC/LXD容器的区别

比较点LXCDocker
Developed byLXC was created by IBM, Virtuozzo, Google and Eric Biederman.Docker was created by Solomon Hykes in 2003.
Data RetrievalLXC does not support data retrieval after it is processed.Data retrieval is supported in Docker.
UsabilityIt is a multi-purpose solution for virtualization.It is single purpose solution.
PlatformLXC is supported only on Linux platform.Docker is platform dependent.
VirtualizationLXC provides us full system virtualization.Docker provides application virtualization.
Cloud supportThere is no need for cloud storage as Linux provides each feature.The need of cloud storage is required for a sizeable ecosystem.
PopularityDue to some constraints LXC is not much popular among the developers.Docker is popular due to containers and it took containers to a next level.
Speed Of DeploymentLXC is not lightweight and consumes a lot of time .Docker Containers are lightweight and fast.

2.2. LXC与LXD区别

LXCLXD
LXC is a virtual environment creation tool, it was built by Google, IBM etc.LXD is an add on for the LXC to provide advanced features and functionalities.
Multiple processes are needed for multiple containers and hence it is not flexible.LXD makes it flexible by providing a single process for multiple containers.
Snapshots, Live Migration【快照和动态迁移】 etc are some of the features which are not supported by LXC.LXD supports snapshots and lives migration features.
Scalability functionality is not provided by LXC and hence users shift to other virtual solutions.With the use of LXD, scalability is achieved in LXC.
Management capabilities are poor, especially in the case of network and storage.It has better management capabilities like storage pooling.
It is not user friendly and needs the expertise to handle the processes.It provides a user-friendly interface.
After data processing, the data cannot be retrieved.Data retrieval functionality after data processing is provided in LXD.
C API is used by the LXC.LXD uses REST API.

2.3. 传统的虚拟机与操作系统虚拟化的区别

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:
阅读全文