Pattern: Missing use of ADD
for extracting archives into an image
Issue: -
Generally speaking, COPY
is preferred because it’s more transparent. 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 /
.