the.com/dockerfile
a recipe so precise it turns your laptop into anyone's laptop.
means a plain-text script of instructions that builds a container image, layer by layer, exactly the same way every time.
from introduced by dotcloud in 2013 as part of docker, borrowing the makefile idea of declarative build steps but for entire operating environments instead of just code.
layer cachingeach instruction adds a cached, reusable filesystem layer
first line rulemust start with FROM or it refuses to build
one process ruleCMD traditionally runs just one foreground process
dockerignore twina hidden sibling file decides what gets excluded
for instance
nginx official image — built from a dockerfile with under 20 lines, millions of pulls weekly
node alpine builds — multi-stage dockerfiles shrink 900mb images down to 40mb
postgres dockerfile — bakes initdb scripts straight into the image on docker hub