How multi-stage Docker builds shrink images, cut attack surface, and improve caching — with real examples for Go, Node.js, and Python.