Challenge 3: Use --target for Testing — Possible Solution ==================================================================== docker build --target builder -t myapp:test-build . WHY THIS WORKS AS AN ANSWER ------------------------------ --target builder tells Docker to stop building at the stage named builder (per this chapter's FROM node:18 AS builder line) and produce an image from that intermediate stage specifically, rather than continuing on to build the final slim stage that follows it in the Dockerfile. This is useful for testing because the builder stage still contains everything needed to actually RUN tests against the application — dev dependencies, the full source tree, and any testing tools — exactly the material the final slim stage deliberately excludes. Using --target avoids needing a completely separate Dockerfile (or a separate test-specific stage) just to get an image with the full build environment available; it reuses the exact same builder stage that already exists as part of producing the real production image, keeping the build definition for both purposes in one file.