Skip to content

Commit

Permalink
Merge pull request quarkusio#38206 from elendis/jib-cache-dirs
Browse files Browse the repository at this point in the history
Add configurations for base image layer and application layer cache in Jib build
  • Loading branch information
geoand authored Jan 16, 2024
2 parents 84abc29 + 9398883 commit 67e59aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,18 @@ public class ContainerImageJibConfig {
*/
@ConfigItem(defaultValue = "true")
public boolean useCurrentTimestampFileModification;

/**
* The directory to use for caching base image layers.
* If not specified, the Jib default directory is used.
*/
@ConfigItem
public Optional<String> baseImageLayersCache;

/**
* The directory to use for caching application layers.
* If not specified, the Jib default directory is used.
*/
public Optional<String> applicationLayersCache;

}
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ private Containerizer createContainerizer(ContainerImageConfig containerImageCon
containerizer.setAllowInsecureRegistries(containerImageConfig.insecure);
containerizer.setAlwaysCacheBaseImage(jibConfig.alwaysCacheBaseImage);
containerizer.setOfflineMode(jibConfig.offlineMode);
jibConfig.baseImageLayersCache.ifPresent(cacheDir -> containerizer.setBaseImageLayersCache(Paths.get(cacheDir)));
jibConfig.applicationLayersCache.ifPresent(cacheDir -> containerizer.setApplicationLayersCache(Paths.get(cacheDir)));

return containerizer;
}

Expand Down

0 comments on commit 67e59aa

Please sign in to comment.