Запустите образ докера, созданный Jib, с несколькими основными классами и выберите, какой основной класс выполнять во врJAVA

Программисты JAVA общаются здесь
Гость
Запустите образ докера, созданный Jib, с несколькими основными классами и выберите, какой основной класс выполнять во вр

Сообщение Гость »


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']
}


Источник: https://stackoverflow.com/questions/781 ... ich-main-c

Вернуться в «JAVA»