01"Works on my machine"
An API that runs on your laptop can fail on a server because of a different Python version, a missing system library (libgomp for XGBoost), different package versions, or environment variables you forgot existed.
A Docker image packages everything the app needs โ OS libraries, the Python runtime, pinned packages, your code and model โ into one immutable artifact. A container is a running instance of that image. The same image runs identically on your laptop, in CI and in production.