LXC vs. libcontainer

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.

Copyright ©2024 Educative, Inc. All rights reserved