What is the difference between Docker, LXD, and LXC

No, LXC, Docker, and LXD, are not quite the same. In short:

LXC

LinuX Containers (LXC) is an operating system-level virtualization method for running multiple isolated Linux systems (containers) on a single control host (LXC host)

https://wiki.archlinux.org/index.php/Linux_Containers

low level ...

https://linuxcontainers.org/

Docker

  • by Docker, Inc
  • a container system making use of LXC containers
  • so you can: Build, Ship, and Run Any App, Anywhere http://www.docker.com

LXD

  • by Canonical, Ltd
  • a container system making use of LXC containers
  • so that you can: run LXD on Ubuntu and spin up instances of RHEL, CentOS, SUSE, Debian, Ubuntu and just about any other Linux too, instantly, ... http://www.zdnet.com/article/ubuntu-lxd-not-a-docker-replacement-a-docker-enhancement/

Docker vs LXD

  • Docker specializes in deploying apps
  • LXD specializes in deploying (Linux) Virtual Machines

Infographic of Docker vs LXD

Source: http://linux.softpedia.com/blog/infographic-lxd-machine-containers-from-ubuntu-linux-492602.shtml

Originally: https://insights.ubuntu.com/2015/09/23/infographic-lxd-machine-containers-from-ubuntu/

Minor technical note

  • installing LXD includes a command line program coincidentally named lxc http://blog.scottlowe.org/2015/05/06/quick-intro-lxd/

This image can help you to understand the main difference between them:

lxc x docker

What all of them have in common, is that all these 3 technologies are related to containers.

Containers are a lightweight virtualization mechanism that does not require you to set up a virtual machine on an emulation of physical hardware. In Linux, what they have in common are the Kernel features used: cgroups, namespaces(ipc, network, user, pid, mount). They also try to create more safe environments by creating unprivileged containers and integrating with security features like selinux. These technologies export APIs to better integrate with other softwares.

LXD and LXC

These two integrates the same family where:

  • lxc: userspace interface for the Linux kernel containment features. This is the guy who manages Kernel namespaces, Apparmor and SELinux profiles, Chroots , Kernel capabilities and every other kernel related stuff
  • lxd: is a container "hypervisor". It is composed by a daemon(lxd), the command-line interface(lxc) and a OpenStack plugin. This guy was developed to provide more flexibility and features to lxc, while it still uses it under-the-hood.

Basically, a Self-Contained OS userpace is created with it´s isolated infrastructure. lxc underlies more directly on OS features for networking and storage than Docker.

You create many virtual machines, that have userspace and kernel isolations, but they are not complete virtual machines since they are not running separeted kernels, neither are paravirtualized for the same reason.

Canonical is the main sponsor here, and Oracle is also investing man hours on this technology.

Docker

It has some differences, being the biggest of them the Engine that wraps-up Applications with a self-contained filesystem instead of a base "Userspace image". The idea is to contain the app and base image to create the impression that the App is a single process inside the engine. Docker used lxc technology as underlying to communicate with the kernel, but today, it uses its own library, libcontainer.

The filesystem is an abstraction to Docker, while lxc uses filesystem features directly. Network is also an abstraction while with lxc you can set up ip addresses and routing configurations more easily. Some "App Store like" sites are being maintained by Microsoft, Amazon, Vmware, IBM and other players.

Docker. INC. is the main sponsor here. Vmware is also investing in this technology.

Related container technology:

These are other container technologies that Linux have: OpenVZ and Linux-VServer

Related Stuff:

  • Linux LXC vs FreeBSD jail
  • Understanding the key differences between LXC and Docker
  • Operating System Containers vs. Application Containers

Tags:

Docker

Lxc

Lxd