What is the purpose of the COPY instruction vs the ADD instruction in a Dockerfile?

Docker Fundamentals Medium

Docker Fundamentals — Medium

What is the purpose of the COPY instruction vs the ADD instruction in a Dockerfile?

Key points

  • COPY copies files from build context; ADD supports more functionalities
  • ADD can extract tar archives and fetch from URLs
  • COPY is recommended for clarity in Dockerfiles
  • Both instructions involve file copying but ADD has additional capabilities

Ready to go further?

Related questions