COPY vs ADD in Docker

The major difference is that ADD can do more than COPY.

A valid use case for ADD is when you want to extract a local tar file into a specific directory in your Docker image. This is exactly what the Alpine image does with:

ADD rootfs.tar.gz /

Also, ADD allows {{ src }} to be a URL

If you are copying local files to your Docker image, always use COPY because it’s more explicit.

COPY is same as ADD, but without the tar and remote URL handling.