Docker Without the Magic
What a container actually is, how a Dockerfile builds an image layer by layer, and the gotchas that bite everyone - so 'works on my machine' stops being a thing that happens to you.
Download EPUB- Image vs Container (and Why Not a VM) An image is a frozen, layered snapshot of a filesystem plus how to run it (like a class); a container is a running instance of that image (like an object); both are far lighter than a VM because they share the host's kernel.
- Building an Image: the Dockerfile & Layers A Dockerfile is a recipe and each instruction builds a cached layer, which is why instruction order decides your rebuild speed; then docker build, docker run with published ports, and pull/push to a registry.
- Volumes & the Gotchas Containers are ephemeral so data dies with them unless you use a volume; config belongs in environment variables; and the classic traps - bloated images, secrets baked into layers, the unpublished port - named before they bite.