Containers package applications with dependencies into portable units. Unlike VMs, containers share the host kernel.
Container vs VM:
- VMs virtualize hardware. Each has its own OS.
- Containers virtualize the OS. They share the kernel.
- VMs start in minutes. Containers in milliseconds.
- VMs use gigabytes. Containers use megabytes.
Container runtimes: Docker, containerd, CRI-O.
Networking challenges:
- Containers are ephemeral. IPs change constantly.
- Thousands per host
- Need service discovery
- External traffic must reach the right container