I created a base image for a Java application using Jib which I want to extend using Jib. (The Java application provides extensibility by loading additional Jars from the classpath)
In the extending gradle project, I did this:
jib {
....
container {
entrypoint = 'INHERIT'
}
...
}
It allowed me to reuse the entrypoint and args attributes added in the base image but I also want to extend/reuse the base classpath file. As Jib creates /app/jib-classpath-file in the extending gradle project, the base layer /app/jib-classpath-file is not visible ( I would assume). To workaround the issue, I added this in extending container configuration block.
extraClasspath = ['/app/libs/*']
Is there an idiomatic way of achieving this in Jib? One option I was thinking is to specify unique classpath files in base and extending projects and use them like this in the Java command line: java -cp @/app/jib-BASE-classpath-file @/app/jib-EXTENDED-classpath-file, but I am not finding the option of specifying the classpath file. What is the recommended way? Thanks