The team needs to place known application source from the build context into a citizen-portal image without unpacking archives or fetching remote URLs. Which instruction is the professional default?
Select an answer to reveal the explanation.
Short Explanation
COPY is the plain envelope: put these files in the box. ADD is the cousin that might also unzip packages or download from the internet—handy once, surprising often.
Full Explanation
When the team already has known application source in the build context, COPY is the professional default for placing that tree into the citizen-portal image. COPY transfers files from context into the image filesystem without unpacking archives and without fetching remote URLs. The semantics are narrow and reviewable, which is what you want for ordinary municipal source trees in CI where surprises create security and reproducibility debt.
ADD is not identical to COPY with no extra semantics: ADD can auto-extract local archives and fetch remote URLs, which complicates code review and reproducible builds. RUN curl is a network fetch during build, not the supported default for including local context files, and it couples build success to external availability. EXPOSE documents a listening port; it neither copies the application tree nor substitutes for COPY.
Exam caveat: style guides prefer COPY unless you deliberately need ADD’s archive or URL behaviors—and when you need them, document why so the next engineer does not inherit a hidden download. Operational check: replace any ADD of plain source with COPY, rebuild, and confirm the image file tree matches while build logs show no unexpected archive extract or remote download step.