Introduction

Containers offer a logical packaging mechanism in which applications can be abstracted from the environment in which they run. Containers are often compared with virtual machines (VMs).  a guest operating system such as Linux or Windows runs on top of a host operating system with virtual access to the underlying hardware. Like virtual machines, containers allow to package your application together with libraries and other dependencies, providing isolated environments for running your software services.



Why Containers?

  • Instead of virtualizing the hardware stack, containers virtualize at the operating system level, with multiple containers running atop the OS kernel directly which means containers are more lightweight: they share the OS kernel, start much faster, and use a fraction of the memory compared to booting an entire OS.
  • Container consists of an entire run-time environment: an application, plus all its dependencies, libraries and other binaries, and configuration files needed to run it, bundled into one package. By containerizing the application platform and its dependencies, differences in OS distributions and underlying infrastructure are abstracted away.

Advantages of Containers

  • A container may be only tens of megabytes in size, whereas a virtual machine with its own entire operating system may be several gigabytes in size.
  • Containerization allows for greater modularity. Rather than run an entire complex application inside a single container, the application can be split in to modules

Linux Containers (LXC) on R-Pi

 LXC (Linux Containers) is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel. LXC relies on the Linux kernel cgroups functionality.


root@raspberrypi-rdk-hybrid-lxc:/usr/bin# ps | grep rmf
root@raspberrypi-rdk-hybrid-lxc:/usr/bin# ps -aef | grep rmf
root 1465 1 0 07:17 ? 00:00:00 /bin/sh /container/RMFSTREAMER/launcher/rmfstreamer.sh start
root 1475 1465 0 07:17 ? 00:00:00 /usr/bin/lxc-execute -n RMFSTREAMER -f /container/RMFSTREAMER/conf/lxc.conf -- /usr/bin/rmfStreamer --config /etc/rmfconfig.ini --debugconfig /etc/debug.ini
rmfstre+ 1497 1475 0 07:17 ? 00:00:00 /init.lxc.static --gid 705 --uid 705 -- /usr/bin/rmfStreamer --config /etc/rmfconfig.ini --debugconfig /etc/debug.ini

References

  • No labels