What is the difference between Docker, LXD, and LXC

190,961

Solution 1

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

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

Solution 2

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:

Share:
190,961

Related videos on Youtube

Ijaz Ahmad
Author by

Ijaz Ahmad

Linux Bash Python Kubernetes ( On-prem, AWS, GKE, DO ) Docker ElasticSearch Gitlab/Github Jenkins DevOps/SRE/Automation/CI/CD Infra as Code, Pulumi, Terraform

Updated on September 18, 2022

Comments

  • Ijaz Ahmad
    Ijaz Ahmad over 1 year

    What is the difference between Docker, LXD, and LXC. Do they offer the same services or different.

  • Ijaz Ahmad
    Ijaz Ahmad almost 8 years
  • Admin
    Admin almost 8 years
    Yeah. Thats pretty new since involves all that zfs on Ubuntu wada-wada. And that is a PRESENTATION. Allways be alert to PDFs or PPTs where there are worlds like "better than that" or "fastest technology" or "more scalable than Y"...
  • orodbhen
    orodbhen almost 8 years
    I've grown to be pretty skeptical of products coming out of Canonical. They tend to advertise them as what they might be instead of as what they are. Often when that "might be" is still years away.
  • 0xC0000022L
    0xC0000022L about 6 years
    Instead of using lowercase lxc, this should be a reference to liblxc. And as far as the tooling is concerned, it can then refer to 1.x through 3.x where lxd (just the daemon) is only available for liblxc >= 2.0 and lxc ist the LXD client program which is the successor to the lxc-*-named LXC 1.x tools.
  • Danny Kopping
    Danny Kopping over 5 years
    Docker hasn't used LXC under the hood since 2014: blog.docker.com/2014/03/…