`COPY` vs `ADD`?
BeginnerConceptDockerfile Instructions & Builds
Answer
COPY copies files from the build context (or another stage). ADD does the same plus auto-extracts local tar archives and can fetch remote URLs (and Git repos). Use COPY by default for clarity; use ADD for local tar extraction, or ADD --checksum=sha256:... URL when you need a verified download.
More on Dockerfile Instructions & Builds
What is the difference between `RUN`, `CMD` and `ENTRYPOINT`?BeginnerHow do ENTRYPOINT and CMD combine?IntermediateShell form vs exec form: what is the practical difference?AdvancedWhat is the build context and why does it matter?BeginnerWhat does `.dockerignore` do?BeginnerHow does the build cache work?Intermediate