-
Notifications
You must be signed in to change notification settings - Fork 749
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
Javacode fails to read dotted environment variables since 08/09/23 #302
Comments
We have exactly same issue so I think this is a real issue. I am running in kubernetes tomcat based docker image using
Based on my investigation, I think 9.0.78 docker image was already released about a month ago since we have been running 9.0.78 tomcat about a month ago already. Everything was working fine at that time. But a few days ago there was an image push with the same tag name and since that 9.0.78 docker image is unable to read these dotted environment variables. At least that is how I have interpreted this one which shows last push 2 days ago: https://hub.docker.com/layers/library/tomcat/9.0-jdk17-temurin-focal/images/sha256-546ed8e4e0eb770203b713be7a0de3905d3cf8a7d25df22683479f8af5994814?context=explore . Even though dotted environment variables are not really recommended, they should be perfectly valid to be used. |
Current fix I have made is to switch back to image |
As you can see from the Dockerfiles, we have haven't changed anything directly in the tomcat image. This sounds very much like #77. The recent images updates are caused by changes/updates in the After reviewing the changes added in the $ docker run -it --rm -e 'variable.with.a.dot=foo' tomcat:9.0-jdk17-temurin-focal env | grep foo
[no output]
$ docker run -it --rm -e 'variable.with.a.dot=foo' --entrypoint='' tomcat:9.0-jdk17-temurin-focal env | grep foo
variable.with.a.dot=foo
$ # really you'll have to set something like this to run tomcat:
$ docker run -it --rm -e 'variable.with.a.dot=foo' --entrypoint='' tomcat:9.0-jdk17-temurin-focal catalina.sh run
$ # or this
$ docker run -it --rm -e 'variable.with.a.dot=foo' --entrypoint=catalina.sh tomcat:9.0-jdk17-temurin-focal run |
The upstream entrypoint is `sh` and so loses dotted environment variables, lets prevent that from happening by just skipping it as the `tomcat` images isn't reliant on its functionality (docker-library/docs#2338). Fixes docker-library#302 which is a recurrence of docker-library#77
The upstream entrypoint is `sh` and so loses dotted environment variables, lets prevent that from happening by just skipping it as the `tomcat` images isn't reliant on its functionality (docker-library/docs#2338). Fixes docker-library#302 which is a recurrence of docker-library#77
The upstream entrypoint is `sh` and so loses dotted environment variables, lets prevent that from happening by just skipping it as the `tomcat` images are not reliant on its functionality. See docker-library/docs#2338 and adoptium/containers#392 for info about what it provides. Fixes docker-library#302 which is a recurrence of docker-library#77
Hello all,
we have noticed that since about 2 days our java servlet cannot read environment variables which have a "." in the name.
Short example:
System.getenv("variable.with.a.dot") returns null
where
System.getenv("variablewithoutdot") returns the correct variable value.
We set the environment variables via the docker compose .env file.
Is this a known issue or does anyone know why the behavior has changed recently?
// Edit: added used version
Thank you very much for your help and hints.
The text was updated successfully, but these errors were encountered: