Book Image

Containerization with LXC

Book Image

Containerization with LXC

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
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface

Summary


The bindings for Python provided by the LXC and libvirt APIs are a great way to programmatically create and manage LXC containers.

In this chapter, we explored both sets of Python bindings, by writing simple code snippets that implement most of the functions provided by the userspace tools. In fact, the best way to learn about those APIs is to look at the source code of the command-line tools, although they are implemented in C.

We had a brief introduction in how to provision LXC with Vagrant for testing your code in isolation. We ended the chapter with a working implementation of a simple RESTful API that uses some of the methods we explored earlier to provision, manage, and destroy LXC. In Chapter 5, Networking in LXC with the Linux Bridge and Open vSwitch, we'll explore the networking aspects of LXC, using the Linux bridge, Open vSwitch in NAT, and direct routing modes, and look into examples of how to interconnect containers and the host OS.