Open rmannibucau opened 3 years ago
Sorry, I'm a bit confused about how exactly you want to configure the base image cache and the application cache for each sub-module, and for what. I also have trouble relating it to enabling mojo configurations.
however each image has its own caching until jib.baseImageCache ... is set.
This isn't true for the base image cache. The base image cache (e.g., often ~/.cache/google-cloud-tools-java/jib/
on Linux) is a central cache intended to be shared by all Jib-based tools (jib-gradle-plugin, jib-maven-plugin, jib-core, jib-cli, ...) and their projects (and sub-projects). Locking is currently used only for saving small JSON files (manifests and image configurations). Although it's possible multiple Jib-based processes or threaded Maven builds may initially download the same blob concurrently in a race condition (#2007), I don't think there's a performance disadvantage for concurrent builds once blobs are cached.
And are you trying to set separate base image caches for each module?-image
? What for?
And for the application layer cache, if you want to have a shared cache, you can set jib.applicationCache
?
As for why we don't normally have mojo configuration for these types of configurations, it's because they are highly system dependent. It's arguable, but for example, we don't want to see a lot of git source repos containing pom.xml
with <directory>C:\some\base\image\cache\dir</directory>
in it.
@chanseokoh what i want to achieve is to ensure all image modules share the same cache but that the cache is per project (to avoid concurrent builds issue or permission issues in some docker setup). So build cache will be something like
Okay, just to confirm, the issue is simply asking for adding Maven/Gradle plugin configuration counterparts for the currently-system-property-only jib.applicationCache
and jib.baseImageCache
, right? (Not that Jib has an issue that prevents you from having all image modules share the same cache but that the cache is per project, right?)
@chanseokoh yes, just exposing jib-core config through
Until I miss it there is no way to configure the cache directories in the mojo configuration. My use case is the following, project layout looks like:
The containerization is configured in images/pom.xml since it is using the same pattern for all images, then running mvn package jib:dockerBuild on images/ folder makes all images at once. This pattern is very convenient, however each image has its own caching until jib.baseImageCache (and app one) is set.
This issue is about enabling: