-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have API in jib-core to control base image caching #1870
Comments
@chanseokoh Is this API still needed since we already have jib.alwaysCacheBaseImage? |
Hi @rajovictor,
That's a good question. Not sure, but I guess it makes sense to have an API.
I think you can just set |
Hi @chanseokoh, |
If public StepsRunner registryPushSteps() {
rootProgressDescription = "building image to registry";
boolean layersRequiredLocally = JibSystemProperties.alwaysCacheBaseImage(); If the property is not set, Jib (and jib-core) will do the skip-base-image-downloading optimization (for registry pushes) by default. If set, the images will always be downloaded. And this issue wasn't about adding the API to |
Ok, using jib.cacheBaseImage and then reverting it to jib.alwaysCacheBaseImage caused the confusion for me - I think I spent too much time reading the comments in #1840. Now, jib.alwaysCacheBaseImage is used in Could you please advise me on how to proceed here? |
Sorry, I'm still confused too. Maybe we are not on the same page. I assume
So, what you can do (for now, until this issue to add an API is closed) is System.setProperty("jib.alwaysCacheBaseImage", "true");
Containerizer containerizer = Containerizer.to(RegistryImage.named("example.com/my/repository"));
Jib.from("example.com/my/base/image").containerize(containerizer); And note that However, do note that setting the system property will affect the whole JVM. That's another reason to have an API to control this. |
I understood the above part fine.
Sorry if I am asking basic questions. |
|
@TadCordle Thank you for stepping in. I will be working on the changes and create a PR. |
Submitted the PR #2065. |
Fixed by #2065. |
Will add a CHANGELOG. |
#1840 introduced the optimization to skip downloading base image layers that exist in a target registry. The only way to disable it is through a system property
jib.alwaysCacheBaseImage
. Add an API to jib-core to control this behavior.The text was updated successfully, but these errors were encountered: