Although ADD and COPY are functionally similar, generally speaking, COPY is preferred. That’s because it’s more transparent than ADD. COPY only supports the basic copying of local files into the container, while ADD has some features (like local-only tar extraction and remote URL support) that are not immediately obvious. Consequently, the best use for ADD is local tar file auto-extraction into the image, as in ADD rootfs.tar.xz /.
Share your thoughts on this, I can open PRs if it sounds good to you.
https://github.com/wyveo/nginx-php-fpm/blob/d10d5bf81bb612f7e7fee6ced5e1dcce22408e3b/Dockerfile#L106-L109
Since this is not currently used for tar extraction nor URLs, shouldn't we use
COPY
instead ofADD
? According to the best practices in the Docker official documentation:Share your thoughts on this, I can open PRs if it sounds good to you.
Cheers