makisu
makisu copied to clipboard
`COPY --from` always breaks cache
@apourchet could you please share more details on this issue?
Currently cache ID calculation is done before the whole build process. The logic is:
- For FROM, the ID is
hash(makisu_version + base_image_sha)
- For ADD/COPY without --from, the ID is
hash(parent_id + hash(source_content))
- For COPY with --from, the ID is always random
- For other steps, the ID is
hash(parent_id + string(current_line))
So we intentionally break the cache chain whenever we see COPY --from
, because at the time of cache ID calculation, we don't know the hash of the files to be copied.
The fix could be simple - move the calculation at the beginning of each stage.
I have the same problem. Any ETA for a fix ?
We will work on this in Q3.