Skip
Arish's avatar

1. What is Docker?


What is Docker?

Docker is a platform for developing, shipping, and running applications in containers.

Containers vs Virtual Machines

FeatureContainersVMs
SizeMegabytesGigabytes
StartupSecondsMinutes
OSShared kernelFull OS
IsolationProcess-levelHardware-level

Why Docker?

  • Consistency: Same environment everywhere
  • Isolation: Apps don't interfere with each other
  • Portability: Run anywhere Docker runs
  • Efficiency: Lightweight and fast

Docker Architecture

┌─────────────────────────────────────┐ │ Docker Client │ │ (docker commands) │ └──────────────┬──────────────────────┘ │ ┌──────────────▼──────────────────────┐ │ Docker Daemon │ │ (manages containers/images) │ └──────────────┬──────────────────────┘ │ ┌──────────────▼──────────────────────┐ │ Container Runtime │ └─────────────────────────────────────┘

Key Concepts

  • Image: Blueprint for containers
  • Container: Running instance of an image
  • Registry: Storage for images (Docker Hub)
  • Dockerfile: Instructions to build an image