Is your feature request related to a problem? Please describe.
In a lot of cases, there will be a layer that's fairly big and is always different every time. However, only a minor part of the layer was actually changed (think NodeJS modules).
Describe the solution you'd like
Support #PATCH keyword. When committing such a layer, in addition to finding layer with expected hash, also add logic to find layer close enough to a given layer. There are a few ways this search feature can be implemented:
Use some form of hash tree.
Add a supplement index purely based on dockerfile content and some metadata (like git repo url)
Add a parameter, let called provide another image for cache analysis.
After a build is done, before pushing layers, if a similar enough layer already exists, just push a patch (using existing layer diff logic), and modify image manifest accordingly.
Additional context
This doesn't improve build time, but could significantly decrease image size and pull time (if upgrade is in-place). Build time improvement should be done by #PREFETCH keyword (see #263)
Is your feature request related to a problem? Please describe. In a lot of cases, there will be a layer that's fairly big and is always different every time. However, only a minor part of the layer was actually changed (think NodeJS modules).
Describe the solution you'd like
#PATCH
keyword. When committing such a layer, in addition to finding layer with expected hash, also add logic to find layer close enough to a given layer. There are a few ways this search feature can be implemented:Additional context This doesn't improve build time, but could significantly decrease image size and pull time (if upgrade is in-place). Build time improvement should be done by
#PREFETCH
keyword (see #263)