Trusted answers to developer questions

LXC vs. libcontainer

Get the Learn to Code Starter Pack

Break into tech with the logic & computer science skills you’d learn in a bootcamp or university — at a fraction of the cost. Educative's hand-on curriculum is perfect for new learners hoping to launch a career.

Before its version 0.9 release in March 2014, Docker used Linux Containers (LXC for short) as its default execution environment. However, with the release, LXC was made optional with Docker’s own libcontainer taking over as the default execution environment. In this shot,​ we will explore why Docker decided to make this switch.

svg viewer

LXC, Docker’s earlier choice, was limited to Linux. It offered a userspace interface for the Linux kernel containment features. Libcontainer, on the other hand, is an abstraction that supports a broader range of isolation technologies.

The other main advantage that libcontainer has over LXC is that it was developed to access the kernel’s container APIs directly to remove dependencies. With its libcontainer library, Docker can manipulate namespaces, control groups, capabilities, apparmor profiles, network interfaces, and firewalling rules without relying on LXC and other external packages. Reduced dependencies make libcontainer more stable and efficient. Libcontainer also allows for more reusability and is easier to adopt by other vendors (like CoreOS) as compared to LXC.

RELATED TAGS

lxc
docker
linux
libcontainer

CONTRIBUTOR

Anusheh Zohair Mustafeez
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?