LXC vs Docker 🤜🏻🤛🏻

linux Dec 22, 2018

Computing in Container...
Many of you would have heard about Docker, some of you would have heard about LinuX Container a.k.a LXC.
Check out below to know about LXC and Docker and how do they compare against each other.

LinuX Container (LXC) is a operating-system-level-virtualization technology for creating and running multiple isolated Linux systems (containers) on a control host using a single Linux kernel. These isolation levels or containers can be used to either sandbox specific applications, or to emulate an entirely new host. The Linux kernel provides the cgroups functionality that allows limitation and prioritization of resources (CPU, memory, block I/O, network, etc.) without the need for starting any virtual machines and application isolation called as namespaces.

Docker is an extension of LXC's capabilities. It uses the resource isolation features of the Linux kernel such as cgroups and kernel namespaces, and a union-capable file system such as OverlayFS and others to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines. A Docker container, does not require a separate operating system. Instead, it relies on the kernel's functionality and uses resource isolation for CPU and memory. Docker accesses the Linux kernel's virtualization features either directly using the libcontainer library, which is available as of Docker 0.9, or indirectly via libvirt, LXC or systemd-nspawn.

Capabilities

LXC containers are often considered as something in the middle between a chroot and a full fledged virtual machine. You can consider LXC as the turbo powered version of chroot. The goal of LXC is to create an environment as close as possible to a standard Linux installation but without the need for a separate kernel.

On the other hand, docker can do more than this. Docker offers a high-level tool with several powerful functionalities:
1. Portable deployment across machines
2. Application-centric
3. Automatic build
4. Component re-use and many more...

Docker vs LXC

Conclusion

LXC offers the advantages of a virtual environment on linux, which consists mainly of the ability to isolate your own private workspace from one another. It is a cheap and quick solution to implement than a VM, but requires a bit of extra learning and expertise.

Docker is a significant improvement over LXC’s capabilities. Its obvious advantages are gaining Docker a growing following of adherents. It is in-fact getting close to negating the advantage of virtual machines over virtual environments because of its ability to quickly and easily transfer and replicate any Docker-created packages.

E

Cyber Security Professional • Offensive Infrastructure • Anime Addict • Love to Travel • Co-creater of rescure.fruxlabs.com •