Docker是一个用于在集中式平台上创建、部署和运行应用程序的开源工具。这使得主机的操作系统通过容器运行具有相同Linux内核的应用程序,而不是创建一个完整的虚拟机。使用docker容器不需要考虑Ram和磁盘空间的分配。它能够自己处理这些需求。
Docker只提供了应用程序的虚拟化,通过cgroup、namespace实现资源隔离,资源限制配置参见resource_constraints。
Docker容器将应用和其依赖环境全部打包到一个单一对象中,在不包含完整的操作系统的情况下就能运行普通应用,更加轻量级,可移植性更好。所以它成为了PaaS(比如Kubernates)平台的基石
Docker提供的特性:
LXC是Linux容器的缩写,Linux容器是一种操作系统,用于通过单个Linux内核在受控主机上虚拟运行多个Linux系统。
LXC与内核的cgroup捆绑在一起,为进程和网络空间提供功能,而不是创建一个完整的虚拟机,并为应用程序提供一个隔离的环境。
LXC代表Linux容器,它是一种用于操作系统虚拟化的工具。通过使用LXC,可以在虚拟环境中而不是在物理系统中操作任何软件或应用程序。虚拟环境功能使LXC更加安全,成本也更低。LXC很容易操作,因为它带有控制组【Control groups Cgroups】功能。
LXC为提供了完整的操作系统虚拟化,
操作系统级虚拟化是一种服务器虚拟化方法,在这种方法中,操作系统的内核允许存在多个孤立且隔离的用户空间实例,而不是只有一个
LCX就是一种轻量级虚拟化,将linux进程沙盒化,使用的是linux中的namespace技术进行资源隔离,
LXC提供的特性:
LXD代表Linux Daemon,它是一个扩展,主要用于指导LXC。它用于向LXC提供新的属性和功能,以便以更有效的方式使用LXC。LXD和LXC之间的通信是通过使用内置库完成的,liblxc就是这样一个库。
比较点 | LXC | Docker |
---|---|---|
Developed by | LXC was created by IBM, Virtuozzo, Google and Eric Biederman. | Docker was created by Solomon Hykes in 2003. |
Data Retrieval | LXC does not support data retrieval after it is processed. | Data retrieval is supported in Docker. |
Usability | It is a multi-purpose solution for virtualization. | It is single purpose solution. |
Platform | LXC is supported only on Linux platform. | Docker is platform dependent. |
Virtualization | LXC provides us full system virtualization. | Docker provides application virtualization. |
Cloud support | There is no need for cloud storage as Linux provides each feature. | The need of cloud storage is required for a sizeable ecosystem. |
Popularity | Due 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 Deployment | LXC is not lightweight and consumes a lot of time . | Docker Containers are lightweight and fast. |
LXC | LXD |
---|---|
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. |