Try to improve the cache behavior for `ADD` and `COPY` commands.
Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
| ... | ... |
@@ -105,12 +105,12 @@ not, the cache is invalidated. |
| 105 | 105 |
of the child images is sufficient. However, certain instructions require |
| 106 | 106 |
a little more examination and explanation. |
| 107 | 107 |
|
| 108 |
-* In the case of the `ADD` and `COPY` instructions, the contents of the file(s) |
|
| 109 |
-being put into the image are examined. Specifically, a checksum is done |
|
| 110 |
-of the file(s) and then that checksum is used during the cache lookup. |
|
| 111 |
-If anything has changed in the file(s), including its metadata, |
|
| 112 |
-then the cache is invalidated. The last-modified and last-accessed times of the |
|
| 113 |
-file(s) are not considered in these checksums. |
|
| 108 |
+* For the `ADD` and `COPY` instructions, the contents of the file(s) |
|
| 109 |
+in the image are examined and a checksum is calculated for each file. |
|
| 110 |
+The last-modified and last-accessed times of the file(s) are not considered in |
|
| 111 |
+these checksums. During the cache lookup, the checksum is compared against the |
|
| 112 |
+checksum in the existing images. If anything has changed in the file(s), such |
|
| 113 |
+as the contents and metadata, then the cache is invalidated. |
|
| 114 | 114 |
|
| 115 | 115 |
* Aside from the `ADD` and `COPY` commands cache checking will not look at the |
| 116 | 116 |
files in the container to determine a cache match. For example, when processing |