Book Image

Containerization with LXC

By : Konstantin Ivanov
Book Image

Containerization with LXC

By: Konstantin Ivanov

Overview of this book

In recent years, containers have gained wide adoption by businesses running a variety of application loads. This became possible largely due to the advent of kernel namespaces and better resource management with control groups (cgroups). Linux containers (LXC) are a direct implementation of those kernel features that provide operating system level virtualization without the overhead of a hypervisor layer. This book starts by introducing the foundational concepts behind the implementation of LXC, then moves into the practical aspects of installing and configuring LXC containers. Moving on, you will explore container networking, security, and backups. You will also learn how to deploy LXC with technologies like Open Stack and Vagrant. By the end of the book, you will have a solid grasp of how LXC is implemented and how to run production applications in a highly available and scalable way.
Table of Contents (17 chapters)
Containerization with LXC
About the Author
About the Reviewer
Customer Feedback

Chapter 3. Command-Line Operations Using Native and Libvirt Tools

LXC supports a variety of backing stores for its root filesystem. In Chapter 2, Installing and Running LXC on Linux Systems we used the default dir type, which creates a directory under /var/lib/lxc/containername/rootfs. Using the default store might be sufficient in some cases, however, to take advantage of more advanced features, such as container snapshots and backups, other types such as the LVM, Btrfs, and ZFS are available.

In addition to container snapshots, LXC provides tools for controlling resource usage through cgroups, the ability to execute programs before, during, and after the container starts, and to freeze/suspend the state of a running LXC instance.

As an alternative to the LXC tools, we will also look at a different set of userspace tools and libraries for creating and managing containers, particularly the one provided by libvirt.

In this chapter, we'll cover the following topics:

  • Building containers using the...