-
Notifications
You must be signed in to change notification settings - Fork 18
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
Update to docker-entrypoint.sh breaks startup #153
Comments
@ddaalhuisen no it was not intended to break this usage. Can you give me an example project / Dockerfile which does not start after the change. FROM jetty:9
ENV JAVA_OPTIONS="-Dlogback.configurationFile=/var/lib/jetty/conf/logback.xml -Xmx2048m -Xms64m -Xmn32m -Dfile.encoding=ISO-8859-1 -Duser.country=NL -Duser.language=nl -Ddatabase.type=postgres -Dwicket.configuration=deployment -Dlogback.statusListenerClass=ch.qos.logback.core.status.OnConsoleStatusListener -Dorg.eclipse.jetty.server.Request.maxFormContentSize=2000000" Then I can start the server and am seeing the correct configuration:
Same result if I do
|
@ddaalhuisen I have added the branch https://github.com/eclipse/jetty.docker/tree/issue-153-jettyexec To build it you can use:
|
Signed-off-by: Lachlan Roberts <[email protected]>
I am working on a reproduction i can give you to demonstrate our issue. I will try to give you a buildable dockerfile which contains our issue, i will get back to you. |
I have stripped out all unnecesarry stuff from our run.sh and docker build. Building the image in the attached zip and starting it using docker-compose produces the aforementioned java issue. Our application does not yet run on Java17 so i havent been able to verify if eclipse-temurin/9.4/jdk17 resolves the issue. |
Ah, you have newlines in the eval "javaOpts=( $JAVA_OPTIONS )"
# alternatively, just overwrite `JAVA_OPTIONS` with the array instead
eval "JAVA_OPTIONS=( $JAVA_OPTIONS )"
...
# And then use it just the args array
# this could also remove the need for the eval if you do the same to "JETTY_PROPERTIES"
exec "$JAVA" "${javaOpts[@]}" "$@" "${javaOpts[@]}" "${JETTY_PROPERTIES[@]}" |
Issue #153 - revert eval of terminating commands
I have tested the revert of this change (#155) and it fixes this issue. For now I have opened docker-library/official-images#15251 to revert this change since multiple people have reported this issue. I will add some additional tests for the various cases with spaces and newlines in parameters to make sure we do not break them again. After that we consider ways at removing the jetty.exec file if deemed necessary. |
@ddaalhuisen as a workaround if you add
to your run.sh file it seems to fix your issue. |
@yosifkit as far as I understand the alpine images don't support bash so that's why we are using sh for the entrypoint |
Thank you, this has fixed it for now! |
@lachlan-roberts The previous solution using For example
and a
This did work fine but now in
So variables are not been expanded anymore. I then tried to use jetty properties and fill them using env variable but that didn't work either or at least I couldn't figure it out. I changed the module to something like
and in my Docker file I then used
However this resulted in jetty properties being expanded to empty strings and in
|
The mapping of the environment variables to java properties is the way to go. Java has a long and bad history with using system environment variables (eg: the Using JETTY_PROPERTIES means those will only apply during the Use normal System properties in JAVA_OPTIONS to do the mapping. Eg:
Referencing a system property in Jetty's start language is still |
I guess because of But I can see the argument of that being an implementation detail of the docker image.
Hmmm not sure what you mean. If I have
in my dockerfile then it will produce a
So I guess the start jar will try to lookup a jetty property or a system property named Before the above change I could even have a second dockerfile for a concrete app that uses my base jetty dockerfile and modifies JETTY_PROPERTIES again, e.g.
This did produce a |
It's just an |
After the update to docker-entrypoint.sh, our application can no longer start, this has caused us to revert to 9.4.50 baseimage.
See 03c0b9d for details.
We use the following java_options when starting:
After the update, our startup now fails with the following error:
Is this intended behaviour?
The text was updated successfully, but these errors were encountered: