Infra & You • Docker LabInteractive
Container InternalsBeginner

Lab 1: Container Isolation & Port Forwarding

Containers are NOT mini-virtual machines. A container is simply a standard Linux process running with restricted visibility enforced by the Linux Kernel through 6 Namespaces and Cgroups.

Core Concepts to Understand:

PID Namespace

Gives the container its own isolated process tree where your app runs as PID 1, while on the host system it has a regular high PID (e.g. PID 48192).

NET Namespace & Port Forwarding (-p 8080:80)

Creates a virtual ethernet interface (veth) connected to the docker0 bridge. Port forwarding configures iptables NAT rules on the host.

Mount (MNT) Namespace & OverlayFS

Gives the container its own private root filesystem (/) layered over the host storage without modifying host files.

Linux Kernel Container Isolation Architecture

How Host Kernel isolates PID, Network & Mounts without a Hypervisor

💡 Click components to inspect internals
HOST LINUX OS (Kernel 6.8 • Shared by all containers)
Container: web-nginxPID 1: nginx
PID Namespace:Isolated Tree (1, 28, 29)
NET Namespace:eth0 → 172.17.0.2
Cgroup Memory:Max 256MB
Container: api-nodePID 1: node
PID Namespace:Isolated Tree (1, 14)
NET Namespace:eth0 → 172.17.0.3
Cgroup Memory:Max 512MB
Shared Host Linux Kernel (Namespaces • Cgroups v2 • OverlayFS • iptables)

💡 Interactive Concept: Click on any container above to inspect how Linux isolation primitives work under the hood.

Quick Run: