Docker images an gina su cikin layers — kowane Dockerfile instruction yana ƙirƙira layer, kuma Docker yana adana layers don sauri sake gina. Fahimtar layers da caching shine makullin rubuce Dockerfiles masu inganci waɗanda suke gina da sauri kuma suna samar da hotuna masu kankanci.
Layers — kowane instruction yana ƙara layer
Each Dockerfile instruction (FROM, RUN, COPY, etc.) creates a read-only LAYER:
→ layers stack to form the image; layers are CACHED and SHARED between images
→ if a layer is unchanged, Docker REUSES the cached layer (skips rebuilding it)
→ Layer caching makes rebuilds fast — only changed layers (and those AFTER) rebuild.
