From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

About containers - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

About containers

- A virtual machine provides enough virtual hardware for an entire OS to run on. If the VM is para-virtualized, the hardware is minimal but is still there and will have memory, drives, and network even if the CPU is shared with the host. The operating system is complete, even if it's a bare-bones OS. In the case of virtualization, a hypervisor may run directly on bare metal. This hypervisor will then start a VM which would contain an entire operating system including an OS kernel. The operating system would contain libraries which provide a platform to run applications on. One virtual machine could run more than one application just like a real physical machine. The hypervisor could also run more than one virtual machine providing isolation between VMs. Starting these virtual machines is much faster than starting a real physical machine, but even at best they may take anywhere from 10 to 60 seconds to boot. You can export these virtual machines to files, distribute them, and deploy them on other hosts, but because of the size of the disk image containing the entire operating system, it may take a substantial amount of time for the process to complete. Containers are a type of virtualization, but they are not virtual machines. A virtual machine focuses on providing a physical computer in software and isolating the entire OS installation. A container is different in that it is focused on an application, an application stack, or even an operating environment. Visualize a running application and the libraries that it needs. Now wrap a container around it so it is segmented from the operating system. This container application is then run on a container engine. Depending on the container engine, this may be a distributable object that can be downloaded and run. Because the container package only holds the application and its libraries, it's very small and it executes as fast as running the application outside of the container. More containers can be started and connected together, so one container may have MariaDB in it, and another has Apache with the two communicating. Non-containerized applications can also be run alongside applications in containers as well. It's important to note that performance-wise there's no difference between running an application natively on Linux, and running one in a container. You're just isolating the containerized application from other applications. You can think of containers as a sort of super chroot environment. The facilities for creating containers such as namespaces and control groups reside in the kernel. To make creating, using, and distributing containers easier, there are other software stacks such as Docker which simplifies the process. Note that both of these technologies are used to isolate applications from one another, but do it using different methods. One technology is not a replacement for the other, and in fact they work quite well together. It is likely that you will be using virtual machines running on physical machines running container engines and applications in the containers.

Contents