Use the COPY instruction to copy only necessary files, avoid executing instruction such as COPY . .
When you write COPY command it will only copy the files you specified. ADD command is used to copy and download anything from internet into your container. ADD have ability to automatically unpack compressed files- recognized compression format (tar, gzip, bzip2, etc).
Example: -