Course: Cloud Computing Technologies
Professor: Fulvio Risso, Politecnico di Torino
Source: Lightweight virtualization: Linux containers, Docker, 75 PDF pages/slides.
Lecture numbering: 07 follows the supplied filename. The source has a missing printed slide number between 72 and 74.

Learning route

The lecture starts from the overhead of full VMs, then explains why cloud platforms use lightweight virtualization. Namespaces isolate what processes can see; cgroups control how much they can consume. LXC combines these Linux mechanisms into machine-like containers. Docker builds an application packaging workflow around images, layers, registries, networking, volumes and Dockerfiles. Orchestration extends the same ideas across many hosts.

What matters most for the exam

Be able to explain the shared-kernel boundary, distinguish namespaces from cgroups, compare VMs/LXC/Docker, trace image/container/layer/volume relationships, explain -p versus -v, and describe how a Dockerfile becomes an image and then a container. The source’s Flatpak/Snap examples, animal analogy, overhead table and historical platform discussion are useful context but lower priority.

Full virtualization creates useful isolation at a cost

A VM carries a guest operating system, libraries and applications above virtual hardware. This supports different operating systems and strong isolation, but every VM needs memory, CPU time, disk space, boot time and OS maintenance. The source frames lightweight virtualization as appropriate when VM overhead is unacceptable and environments must be created, moved or discarded quickly.

The shared-kernel boundary

A Linux container isolates processes and resources while all containers use the host Linux kernel. It does not emulate hardware and does not run an independent guest kernel. Different Linux userspaces can be packaged, but the host kernel and CPU architecture still matter. Container security depends on configuration, permissions, kernel isolation and runtime policies; it is not automatic.

Linux building blocks

Namespaces answer what can this process see? PID, network, mount, UTS, user and IPC namespaces provide separate views of selected kernel resources. Cgroups answer how much may this workload consume? They control CPU, memory, disk I/O and other resources. Capabilities, AppArmor/SELinux and seccomp add security restrictions. A private network namespace alone does not prevent memory exhaustion; visibility and resource consumption are separate controls.

LXC and Docker

LXC combines namespaces, cgroups, filesystem setup, capabilities and security policies behind userland configuration tools. Its mental model is a lightweight machine or server. Docker uses similar kernel primitives but focuses on packaging and deploying an application with its dependencies. LXC is therefore more system-oriented; Docker is more application-oriented and portable through image distribution.

Docker objects and data path

An image is an immutable template; a container is an instance with a writable layer. Images are built from reusable read-only layers. Copy-on-write stores a container’s modifications above those layers, so deleting the container removes that writable state. Volumes or mounted host directories hold data that must survive container deletion. A registry stores and distributes images; a local cache stores images already pulled.

Docker’s default bridge network connects containers through virtual Ethernet, a Linux bridge, routing and NAT. docker run -p 8080:80 nginx publishes host port 8080 to container port 80. docker run -v /html:/usr/share/nginx/html nginx makes host storage available inside the container. Port publication and storage mounting solve different problems.

Building and operating applications

A Dockerfile records how to create an image. FROM selects a base, RUN performs build steps, EXPOSE documents a port, and CMD/ENTRYPOINT define the default process. Multistage builds keep compilers and build tools in an intermediate image and copy only the runtime files into a smaller final image. Compose describes multiple cooperating services in YAML; Swarm and Kubernetes orchestrate containers across hosts.

Lower-priority context

Flatpak and Snap package Linux applications with their dependencies using standard Linux mechanisms; they are related to application isolation but are not LXC or Docker. The pets/cattle/chickens/insects analogy describes a move from unique servers to replaceable VMs, dense containers and short-lived functions. The source’s overhead table emphasizes low container CPU, memory and boot overhead, while warning that image storage, downloads, updates and security maintenance still cost time and resources.

Source map

PDF pagesTopic
1-17VM overhead, cloud-native motivation, lightweight virtualization and container properties
18-22Pets/cattle analogy, platform evolution, Flatpak and Snap
23-27LXC features and limitations
28-35Docker goals, LXC comparison and application focus
36-47Images, registries, networking, filesystems and union layers
48-55Container lifecycle, ports, volumes, inspection and debugging
56-63Dockerfiles, layers, base images and multistage builds
64-69Docker architecture, overhead, resource use and maintenance
70-75Swarm, Compose, conclusions and orchestration

Retrieval questions

  1. Why can a container start faster than a VM?
    Because it starts application processes without booting a guest kernel and operating system.
  2. What is the namespace/cgroup distinction?
    Namespaces isolate visibility; cgroups control resource consumption.
  3. Why does -p differ from -v?
    -p publishes a network port; -v mounts storage.
  4. Why is Docker more portable than manually configured LXC?
    Docker packages application files and dependencies into shareable, versioned images.
  5. What survives deleting a container?
    The image and external volume data can survive; the container’s writable layer normally does not.