# Knowledge Check: Dockerfile and Image Build --- **1. What does `WORKDIR` actually set?** *Answer:* The working directory for every subsequent instruction in the build, and the container's default working directory when it runs. --- **2. What is the "build context"?** *Answer:* The directory (usually specified as `.` at the end of `docker build -t tag .`) that Docker can see and copy files FROM during the build — `COPY` instructions read from it. --- **3. Why does instruction order in a Dockerfile affect build speed?** *Answer:* Docker caches each instruction's result as a layer and reuses cached layers for unchanged instructions — everything before the first ACTUALLY-changed instruction stays cached, so putting rarely-changing instructions (like dependency installs) before frequently-changing ones (like application code) minimizes unnecessary rebuilding. --- **4. What's `.dockerignore` for, and what other file does it resemble?** *Answer:* It excludes files from the build context (keeping large/irrelevant files out of the image and speeding up builds) — the same idea as ROOT 03's `.gitignore`. ## Instructor Notes **Facilitation:** Question 3 directly reinforces the caching demo — a good check that the concept, not just the observation, landed. **Approximate timing:** 5 minutes.