I have a java gradle project with multiple main class, i want to build a docker image with Jib and chose which main class to run when i execute docker run.
Is it possible to do this with Jib or i have to build multiple docker image for each main class i have ?
If i dont choose a mainclass in jib gradle config, it failed with :
Multiple valid main classes were found: ...
I try with a custom entrypoint, but no success for now, but i dont no how to pass the MainClass as an argument
container {
entrypoint = ['/bin/sh', '-c', 'java -cp $( cat /app/jib-classpath-file ) MainClass']
}
I finally found a solution quite simple with jib :
and