Is the cache layer only used to build the same image? #55
-
When buildpack builds the image sample-java:v1, it downloads jdk or jre related content, but when I build sample-java:v2, buildpack will still download related content. I just modified some source code and did not Change the content of the buildpack. Is there a problem with the method I use, or is there another way to solve my problem? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The project has made the decision to try to prevent contamination between image builds. What this means is that by default caches are determined by image name (including tag). There was a recent feature that should allow you to share cache although it's more intended to solve other problems (specifically caching in CI/CD environments). Essentially, you can cache the contents in a "cache-image" and you can specify the same cache image for both images. See https://buildpacks.io/docs/app-developer-guide/using-cache-image/. Keep in mind, that this introduces the risk of cache poisoning. This option is also available for the Lastly, |
Beta Was this translation helpful? Give feedback.
The project has made the decision to try to prevent contamination between image builds. What this means is that by default caches are determined by image name (including tag). There was a recent feature that should allow you to share cache although it's more intended to solve other problems (specifically caching in CI/CD environments).
Essentially, you can cache the contents in a "cache-image" and you can specify the same cache image for both images. See https://buildpacks.io/docs/app-developer-guide/using-cache-image/. Keep in mind, that this introduces the risk of cache poisoning.
This option is also available for the
lifecycle
if you are using buildpacks in a different platform thanpack
.