Docker process Dockerfile
stepping through the instructions.
https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache
https://docs.docker.com/engine/reference/builder/#/add
https://docs.docker.com/engine/reference/builder/#/copy
Because image size matters, using ADD to fetch packages from remote URLs is strongly discouraged; you should use curl or wget instead.
That way you can delete the files you no longer need after they've been extracted and you won't have to add another layer in your image.RUN mkdir -p /usr/src/things \
&& curl -SL http://example.com/big.tar.gz \
| tar -xJC /usr/src/things \
&& make -C /usr/src/things allFor other items (files, directories) that do not require ADD’s tar auto-extraction capability, you should always use COPY.“
From source code comment:
Same as 'ADD' but without the tar and remote url handling.
From Docker docs:
ADD or COPY
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 /.