Robot Operating System Cookbook
上QQ阅读APP看书,第一时间看更新

Getting ready

LXC (Linux Containers) is an OS-level virtualization technology that allows the creation and running of multiple isolated Linux virtual environments (VE) on a single control host. These isolation levels or containers can be used to either sandbox specific applications or emulate an entirely new host. LXC uses the Linux cgroups functionality, which was introduced in version 2.6.24, to allow the host CPU to better partition memory allocation into isolation levels called namespaces (https://linuxcontainers.org/).

Docker, previously called dotCloud, was started as a side project and only open sourced in 2013. It is really an extension of the LXC capabilities. This it achieved using a high-level API that provides a lightweight virtualization solution to run processes in isolation. Docker is developed in the Go language and utilizes LXC, cgroups, and the Linux kernel itself. Since it's based on LXC, a Docker container does not include a separate operating system; instead it relies on the operating system's own functionality, as provided by the underlying infrastructure. So, Docker acts as a portable container engine, packaging the application and all of its dependencies in a virtual container that can run on any Linux server (https://www.docker.com/).

Note that a Linux VE is distinct from a virtual machine (VM).