Skip to content

Docker Overview

First PublishedByAtif Alam

Docker is a platform for building, shipping, and running applications in containers. A container packages your app and its dependencies into a single runnable unit that behaves the same on your laptop, CI, and production servers.

  • Consistency — “It works on my machine” goes away. The same image runs identically everywhere Docker runs.
  • Isolation — Each container has its own filesystem, network, and process space. No dependency conflicts between apps.
  • Portability — Build once, run on Linux, macOS, Windows (with WSL2), or in the cloud.
  • Efficiency — Containers share the host kernel and start in seconds, unlike full VMs.
Containers (Docker)Virtual Machines
IsolationProcess-level; shares host kernelFull machine; own kernel per VM
Start timeSecondsMinutes
SizeMB (image layers)GB (full OS)
Use caseApp runtime, microservices, CILegacy apps, strong isolation, different OS
  • Image — A read-only template (filesystem + config). Built from a Dockerfile or pulled from a registry.
  • Container — A running instance of an image. You can have many containers from the same image.
  • Dockerfile — A text file of instructions (FROM, RUN, COPY, etc.) used to build an image.
  • Registry — A store for images (Docker Hub, Amazon ECR, Google GCR, private registries).
  • Docker Compose — A tool and file format (docker-compose.yml) to run multi-container apps with one command.
  • Installation — Install Docker Engine on Linux, Mac, or Windows (WSL2); verify with docker run hello-world.
  • Dockerfile — FROM, RUN, COPY, WORKDIR, ENV, EXPOSE, CMD, ENTRYPOINT, multi-stage builds, and .dockerignore.
  • Images and Registries — Building and tagging images, layers, pushing and pulling (Docker Hub, ECR, etc.).
  • Running Containersdocker run options (-d, -it, -p, -v, -e), lifecycle, logs, and exec.
  • Docker Compose — Compose file (services, networks, volumes), docker compose up/down/ps, multi-container apps.
  • Volumes and Storage — Volumes vs bind mounts vs tmpfs, persistence, docker volume.
  • Networking — Default networks (bridge, host, none), user-defined networks, container DNS.
  • Best Practices — Small images, non-root user, health checks, security, and layer caching.