#Container Fundamentals
Understand what containers are and why they matter.
#Containers vs VMs
| Feature | Containers | VMs |
|---|---|---|
| Isolation | Process level | Hardware level |
| Boot time | Milliseconds | Minutes |
| Size | MBs | GBs |
| Overhead | Minimal | Significant |
| Portability | Excellent | Good |
#Container Architecture
diagram
┌─────────────────────────────────────┐ │ Container 1 │ │ ┌─────────────┐ ┌─────────────┐ │ │ │ App │ │ Libs │ │ │ └─────────────┘ └─────────────┘ │ ├─────────────────────────────────────┤ │ Container Runtime │ │ (Docker, containerd) │ ├─────────────────────────────────────┤ │ Host OS (Linux) │ ├─────────────────────────────────────┤ │ Hardware │ └─────────────────────────────────────┘
#Key Concepts
| Concept | Description |
|---|---|
| Image | Read-only template for containers |
| Container | Running instance of an image |
| Registry | Storage for images (Docker Hub) |
| Layer | Image is built in layers |
| Volume | Persistent storage |
| Network | Container networking |
#Benefits
- Consistency: Same everywhere
- Isolation: Process isolation
- Portability: Run anywhere
- Efficiency: Share OS kernel
- Scalability: Easy to scale
[!TIP] Pro Tip: "It works on my machine" is solved by containers!