Dockerfile contains two very similar commands, COPY and ADD. Both do very similar things. Here's what the documentation says.

The ADD instruction copies new files, directories or remote file URLs from <src> and adds them to the filesystem of the image at the path <dest>.

The
COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>.

Q. So what's the difference between the two?

A. ADD supports remote URL and TAR handling. 

If the src is a URL, then ADD will download the file from the URL and copy to the destination.

If the src is a tar archive, then it will be unzipped as a directory. However, it won't unzip the resources from the remote URLs. 

COPY only works with the files and directories, and doesn't support remote URL and TAR handling.