
LXC containers are meant to be similarly “contained” as docker containers For instance, to create an Ubuntu image you need this example ubuntu build spec and following command: distrobuilder build-lxd ubuntu.yaml In case you would like to create your own image from scratch you could use a tool like distrobuilder which is meant to create rootfs Linux filesystems as well as LXC and LXD images. Downloading and running an official image is similar to docker pull syntax: lxc launch ubuntu:14.04 Here you can find their current images, as well as their sources.

The standard way to handle LXC images is to use their community-supported image store. Not running a separate kernel has some security considerations, but for many use-cases, this is an adequate way to separate applications while sharing single host resources. Whereas LXC provides virtual machines, that leverage the Linux kernels to stay as lightweight as possible.

Docker tries to provide single-app containers to be run in mostly microservice architecture (it can do more, but this is where it shines). But their approach is significantly different. The previous paragraph might remind you of Docker, and indeed early versions of docker were built on top of LXC. Cgroups on the other hand, provide CPU prioritization functionality and ensure resource limits you set are respected. This is how you can get a virtual network interface or any other device inside your LXC or Docker container. Namespaces allow you to create virtual “hardware” and assign system resources inside the said namespace. They try to get as close to being a complete Linux installation without wasting resources on a separate kernel per container.Īs we already mentioned in a previous article on how Docker containers work, LXC runs on top of Linux namespaces and cgroups.

Linux Containers or LXC for short, provide easy tools for managing Linux kernel cgroups and namespaces in order to allow easy content management. LXC is a set of tools that provides lightweight virtualization with a shared kernel.
