Docker for Developers: The 2026 Edition
By Huzi
File #131 · 3 min read
Docker for developers in 2026 ends the ritual of code running on your laptop but dying on the server. Every developer knows the ritual: code runs on your laptop, dies on the server. The Python version differs, a system library is missing, and nobody can reproduce the failure on purpose. Docker ends the ritual by shipping the environment with the code — one artifact that runs the same way anywhere.
The quick answer: An image is the blueprint, a container is one running instance of it, and a registry is where images travel between machines. Multi-stage builds keep the artifact slim, cache mounts keep rebuilds cheap, and the Dockerfile below is worth copying whole.
| The word | What it actually is |
|---|---|
| Image | The blueprint, versioned in layers |
| Container | One running instance of an image |
| Registry | Where images travel between machines |
| Multi-stage build | Dependencies installed in one stage, only the result copied into a slim runtime |
| Cache mount | Stops pip re-downloading the world on every build |
Containers, not virtual machines
A container packages the app and its dependencies and shares the host kernel; a VM virtualizes hardware and carries a whole guest operating system. That is the difference between megabytes and gigabytes, seconds and minutes of startup. One host runs dozens of containers comfortably, and Docker now even runs WebAssembly images for edge workloads smaller still.
A Dockerfile worth copying
Multi-stage builds install dependencies in one stage and copy only the result into a slim runtime. Cache mounts stop pip from re-downloading the world on every build, a non-root user is now a hard requirement in Kubernetes, and gunicorn replaces the Flask dev server for production:
# syntax=docker/dockerfile:1.7
FROM python:3.13-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --user --no-cache-dir -r requirements.txt
FROM python:3.13-slim
WORKDIR /app
COPY --from=builder /root/.local /root/.local
COPY . .
RUN useradd -m appuser
USER appuser
ENV PATH=/root/.local/bin:$PATH
EXPOSE 8000
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app"]
Pro tip: Notice that
requirements.txtgets copied before the rest of the code — that ordering keeps the dependency layer cached while the app itself changes, so ordinary edits stay cheap to rebuild.
Build, run, ship
docker build -t my-app .
docker run -p 8000:8000 my-app
docker push ghcr.io/you/my-app:1.0
The image on a colleague's machine behaves like yours because it is yours — every layer, byte for byte, on Docker Hub, GHCR or ECR.
That is also the whole travel-agent fantasy: one plan that behaves the same in any city, on any device, whoever opens it. HTG Travel builds trips that way — every ticket and confirmation living in one thread, so the itinerary survives whichever laptop you left at home.
Compose for the whole stack
Real apps need a database, and Compose declares the pair in one file. The healthcheck with pg_isready plus depends_on means your web container waits for a genuinely ready database, not merely a started one:
services:
web:
build: .
ports:
- "8000:8000"
environment:
DATABASE_URL: postgres://app:secret@db:5432/app
depends_on:
db:
condition: service_healthy
db:
image: postgres:17-alpine
environment:
POSTGRES_PASSWORD: secret
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app"]
interval: 5s
Run docker compose up --build and the stack is live in seconds.
Why teams keep it: consistency from laptop to CI to production, isolation between apps with conflicting dependencies, and portability to ECS, Cloud Run or any Kubernetes cluster. The learning curve is one honest afternoon; the payoff is never debugging an environment mismatch again.
Gaza's families carry entire households in whatever transport remains and rebuild a routine wherever they land — a resilience no one should have needed. Sudan's engineers packed whole lives into single bags when the war reached Khartoum — may they unpack somewhere permanent.
First deploys have checklists, and so do first trips abroad. We handle first-timers gently at HTG Travel — Dubai and Gulf ticketing, the visa, the airport walkthrough, what goes in the carry-on. You bring the nerves; we bring the runbook, and nobody travels alone. Text your dates to +92 317 5054959 for the post-release detox trip up north.




