quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

support quarkus.jib.jvm-entrypoint=INHERIT

Open Dieken opened this issue 3 years ago • 6 comments

Description

https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin

Both jib-maven-plugin and jib-gradle-plugin support jib.container.entrypoint=INHERIT to inherit container entrypoint from base image, but quarkus-container-image-jib always overrides container entrypoint.

Implementation ideas

https://github.com/quarkusio/quarkus/blob/main/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java#L382

When entrypoint is ["INHERIT"], call jibContainerBuilder.setEntrypoint(null).setProgramArguments(jibConfig.jvmArguments).

Dieken avatar Sep 19 '22 16:09 Dieken

/cc @geoand

quarkus-bot[bot] avatar Sep 19 '22 16:09 quarkus-bot[bot]

We can't really support this, because we always need to point to the Quarkus jar.

geoand avatar Sep 20 '22 05:09 geoand

That's not true, currently I use this command:

./mvnw clean package
 -Dquarkus.container-image.build=true
 -Dquarkus.container-image.push=true
 -Dquarkus.container-image.image="$OCI_IMAGE"
 -Dquarkus.jib.base-jvm-image="$OCI_BASE_IMAGE"
 -Dquarkus.jib.environment-variables.JAVA_APP_JAR=/app/quarkus-run.jar
 -Dquarkus.jib.environment-variables.JAVA_OPTIONS="$JAVA_OPTIONS"
 -Dquarkus.jib.jvm-entrypoint="/bin/sh,-c,mkdir -p config log secret && exec /bin/sh /app/run-java.sh"
 -Dquarkus.jib.working-directory=/app

/app/run-java.sh is from src/main/jib/app/run-java.sh, which is downloaded from https://github.com/fabric8io-images/run-java-sh/blob/master/fish-pepper/run-java-sh/fp-files/run-java.sh

I would like Quarkus to support this usage to inherit entrypoint from base image.

  ....
 -Dquarkus.jib.jvm-arguments="/bin/sh,-c,mkdir -p config log secret && exec /bin/sh /app/run-java.sh"
 -Dquarkus.jib.jvm-entrypoint=INHERIT

Dieken avatar Sep 20 '22 10:09 Dieken

Interesting point.

geoand avatar Sep 20 '22 10:09 geoand

As you have already analyzed the code, would you like to take a shot at implementing your proposal?

geoand avatar Sep 20 '22 10:09 geoand

ok, let me try :-)

Dieken avatar Sep 20 '22 10:09 Dieken