-
Notifications
You must be signed in to change notification settings - Fork 475
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
8u131 Environment Variables with periods (dots) are removed #135
Comments
Are you using alpine images? We faced this issue not so long ago, the root cause was Alpine version change from 3.5 to 3.6 - https://bugs.alpinelinux.org/issues/7344 (btw the issue is not in lowercase but in dots in the name - sh just ignores them since it's not POSIX) For our images we just added bash and used it instead of sh through exec syntax:
|
Looks like this also happens in the Debian based images with the move from Jessie to Stretch. The cause is an update to the dash package that provides It looks like the only solution is to use |
I'm leaning toward not installing Hopefully this issue will help users find the solution to their environment variable problem. |
Yeah, adding |
My vote would be to move to |
That said, since it indeed can have some impact on Java world, I'm not against including it by default in openjdk-specific images - it will simplify one-liners for executing java processes inside docker images and having ability to pass env vars with dots out of the box - this is the only advantage I see. For all other things adding bash into image is a matter of a single line and can be done by whoever needs it. |
@idntfy I'm not sure what you mean by passing the environment variables into the container without dots and then with dots into the java process. Can you please elaborate. If you're referring to SpringBoot's automatic conversion whereby |
@pluttrell Something like |
After spending hours trying to figure out why our images pass IT's on some systems and not on others (cached 8u111 images were working... updated images weren't)... I can say that this is pretty hard to find. Also, Java promotes the usage of "dotted" variables. So, it seems if |
Using a shell at all is not a requirement for using this image -- invoking Java directly does not suffer from this, nor does invoking Java from an installed Bash shell, so I'm still inclined to say this definitely is not an issue we can really "solve" in the base image. Just installing I'd love to see some documentation from upstream Java where they promote the use of environment variables with periods in them, but regardless I just don't see anything actionable here beyond perhaps a small blurb in the documentation for the Alpine image variants which notes that the default |
might related docker-library/python#331 |
I spend a whole day to figure out this strange issue, in the end I changed the env variable name without dots. But I did not know the root case. Now I see the whys, thanks. |
Thanks for this. I've also spent half a day on this until reading this issue. Then, I printed all the environment variables inside Java application and voila! The ones with dots are gone. |
With
8u121
lower case environment variables worked, but with8u131
they do not.Sending lower case environment variables is important because Spring Boot can use them to configure JavaMail, which requires certain lower case properties. For example GMAIL's SMTP server requires
spring.mail.properties.mail.smtp.starttls.enable=true
. If you convert this toSPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLES=true
, JavaMail will ignore the value.I have created a simple project that demonstrates the issue. Build and execution instructions are listed in the README.md. https://github.com/pluttrell/bootvars
The text was updated successfully, but these errors were encountered: