Skip to content
Theory · Dockerfile, layers and the cache · lesson 7 of 8

COPY or ADD

Two instructions put ready-made files into an image: COPY and ADD. They are written the same way — where to take it from and where to put it — and other people's Dockerfiles often use ADD where COPY would do. The difference shows on two kinds of source: archives and links on the internet.

In this lesson

  • COPY puts files in as they are
  • ADD: two extras
  • Which to choose
  • Common mistake
  • Key points