Building and manipulating LXC containers

Managing the container life cycle with the provided userspace tools is quite convenient compared to manually creating namespaces and applying resource limits with cgroups. In essence, this is exactly what the LXC tools do: creation and manipulation of the namespaces and cgroups we saw in Chapter 1, Introduction to Linux Containers. The LXC tooling implements functions defined in the liblxc API, as we'll see in Chapter 4, LXC Code Integration with Python.

LXC comes packaged with various templates for building root filesystems for different Linux distributions. We can use them to create a variety of container flavors. For example, running a Debian container on a CentOS host. We also have the option of building ...

Get Containerization with LXC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.