Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jib: respect JAVA_OPTIONS env var in entrypoint #12578

Closed
rvansa opened this issue Oct 7, 2020 · 6 comments
Closed

Jib: respect JAVA_OPTIONS env var in entrypoint #12578

rvansa opened this issue Oct 7, 2020 · 6 comments
Labels
area/container-image kind/enhancement New feature or request triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@rvansa
Copy link
Contributor

rvansa commented Oct 7, 2020

Description
Containers created using container-image-jib should respect env var JAVA_OPTIONS set for the container.

Implementation ideas
"Standard" base images for Java have some sort of run-java.sh script that counsel JAVA_OPTIONS and pass these to the JVM. Jib does only use java $(quarkus.jib.jvm-arguments) -jar quarkus-run.jar where quarkus.jib.jvm-arguments is set at build time. That limits the options to use the entrypoint as-is.

@rvansa rvansa added the kind/enhancement New feature or request label Oct 7, 2020
@quarkusbot
Copy link

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Oct 8, 2020

Interesting, thanks!

Do you have an example run-java.sh script?

@rvansa
Copy link
Contributor Author

rvansa commented Oct 8, 2020

@geoand Actually the default base image quarkus.jib.base-jvm-image -> fabric8/java-alpine-openjdk11-jre contains /deployment/run-java.sh - this requires JAVA_APP_JAR env var though and does more. In my simplistic case it was enough to add

#!/bin/sh

if [ -z "$JAVA_OPTIONS" ]; then
  JAVA_OPTIONS="-Djava.util.logging.manager=org.jboss.logmanager.LogManager"
fi

java $JAVA_OPTIONS -jar quarkus-run.jar
``

@rvansa
Copy link
Contributor Author

rvansa commented Oct 8, 2020

Also what's the recommended way to add such custom entrypoint script? I have created a base image since I wanted to install jq to the image and add some additional files, but it seems that it's not possible to easily add files via quarkus.container-image.*

@geoand
Copy link
Contributor

geoand commented Oct 8, 2020

Right!

What you want is basically covered by #10011 and #10071.

We haven't documented this feature as it's basically the same as what Jib proper offers, but I am thinking that we probably should...
Would you be willing to contribute that improvement?

@geoand
Copy link
Contributor

geoand commented Jul 26, 2021

What I mentioned above is actually part of the documentation now, so I'll close this

@geoand geoand added the triage/out-of-date This issue/PR is no longer valid or relevant label Jul 26, 2021
@geoand geoand closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container-image kind/enhancement New feature or request triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

3 participants