-
Notifications
You must be signed in to change notification settings - Fork 23
Description
The Best Practices documentation from Docker has changed and they now recommend using the ADD instruction when you need to download a remote artifact as part of your build, allowing for a more precise build cache.
The ADD instruction is best for when you need to download a remote artifact as part of your build. ADD is better than manually adding files using something like wget and tar, because it ensures a more precise build cache. ADD also has built-in support for checksum validation of the remote resources, and a protocol for parsing branches, tags, and subdirectories from Git URLs.
From a previous issue, I could not find the quoted paragraph on the documentation anymore.
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.
Would it be possible to update the rule to support ADD when fetching files from remote (HTTPS or Git Urls) and extracting tar file automatically when adding files from the build context?
ADD supports features for fetching files from remote HTTPS and Git URLs, and extracting tar files automatically when adding files from the build context.