Docker Study Material

What is Docker?

Docker is a platform for packaging an application together with everything it needs to run (runtime, libraries, system tools, configuration) into a single unit called a container image. The image runs the same way on a laptop, a test server or the cloud.

The classic problem Docker solves: "it works on my machine". Different OS versions, library versions or missing dependencies break apps when they move between environments. A container carries its environment with it.

Why Developers Use Docker

  • Consistency: the same image runs in development, CI and production.
  • Fast setup: start PostgreSQL, Redis or Kafka with one command, no installation.
  • Isolation: apps with conflicting dependencies run side by side.
  • Lightweight: containers start in seconds and share the host OS kernel.
  • Cloud native: Kubernetes, Cloud Run, ECS and most CI systems run containers.

Key Terms

TermMeaning
Imagea read-only template: your app + its environment, built from a Dockerfile
Containera running (or stopped) instance of an image
Dockerfilea text file with instructions to build an image
Registrya server that stores images (Docker Hub, Google Artifact Registry, Amazon ECR)
Volumepersistent storage that outlives containers
Docker Composea tool to define and run multi-container apps from one YAML file

Tip: Analogy: an image is like a class, a container is like an object created from it. You can run many containers from one image.