-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty 10.0.15: Env variable in console-capture.ini not expanded anymore #9663
Comments
And for the record, environment variable expansion was never a supported feature of |
@lachlan-roberts can you give docker a check to ensure that all is good after #9309... including documentation. |
@joakime Yes that is why we eval'd the final command. As far as I know Jetty only supports expanding jetty properties in *.mod files, right? At least there are some mod files that use So what is the preferred way of configuring Jetty when using Docker/Docker Swarm/Kubernetes and usually using environment variables to configure the container? For example I tried saving the output of Next I tried using Currently the easiest workaround for me is to take my existing entrypoint and let it Wouldn't it be easier in general if jetty would implement expanding env variables in mod/ini files as well? The code should already exist because of expanding jetty properties, just the source is a different one. |
You could pass in shell environment variables as Java system properties, then they are expanded by the Jetty start mechanism. As any property in a Jetty Start configuration can contain characters that are interpreted special on different shells, the Some examples of problematic properties.
|
this was the workaround for the official Jetty docker image |
@lachlan-roberts Thanks. I am currently experimenting with moving to the official jetty image to experience less surprises while upgrading jetty. But if migration doesn't work well then I try to replicate your workaround in my custom image. |
@lachlan-roberts Please see #8348 (comment) It is now almost impossible to use |
This issue has been automatically marked as stale because it has been a |
Being handled by #11408 |
Jetty version(s)
10.0.15
Java version/vendor
(use: java -version)
OpenJDK Runtime Environment Temurin-19.0.1+10 (build 19.0.1+10)
OpenJDK 64-Bit Server VM Temurin-19.0.1+10 (build 19.0.1+10, mixed mode, sharing)
OS type/version
Docker Ubuntu image / Mac OS
Description
I used 10.0.13 and have customized
jetty-base/start.d/console-capture.ini
usingjetty.console-capture.dir=logs/${INSTANCE_NAME}
withINSTANCE_NAME
being an environment variable.Because Jetty is run in a docker container and because Jetty forks a new VM because of a module, we used a docker entrypoint script that does:
With Jetty 10.0.15 the
--dry-run
command now emits properties wrapped with single tick quotes ('jetty.console-capture.dir'='logs/${INSTANCE_NAME}'
) which in turn disables further variable expansion using the above approach.So Jetty now fails to start as it can not create directory
logs/${INSTANCE_NAME}
.To mimic the above in shell you could do
While we use a custom docker image I think your official jetty image might also be affected.
The text was updated successfully, but these errors were encountered: