What is the difference between Docker COPY and ADD instructions?

Easy Topic: Docker May 24, 2026

Both copy files into the image, but ADD has extra functionality that makes it unpredictable:

  • ADD can fetch files from a URL
  • ADD auto-extracts tar archives into the destination

Best practice: Always use COPY unless you specifically need the URL or auto-extraction features. COPY is explicit and predictable, which is better for reproducible builds.

← Previous How do you implement health checks in Docker...

Practice Similar Questions

Back to Docker Topics