-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
[Bug]: dotted environment variables are lost #415
Comments
Thanks for the report. The change is being backed out right now (docker-library/official-images#15192) until we solve this. We'll need to add |
* Relocate entrypoint script to a less common location This avoids clashing with pre-existing downstream images which have used a custom entrypoint script at e.g. /entrypoint.sh * Use bash as shebang in entrypoint scripts Ref: #415 * Apply suggestions from code review --------- Co-authored-by: George Adams <georgeadams1995@gmail.com>
@yosifkit I'm looking back at this error again to see if we can remove the bash dependency on Alpine. One question I had was how does Docker handle dotted environment variables in the base image when there's no bash shell? docker run --rm -e "variable.with.a.dot=value" alpine env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=a049f2328bb6
variable.with.a.dot=value
HOME=/root Is this some special docker logic that's happening behind the scenes? And can we benefit from this same logic in our |
Docker isn't doing anything extra for environment variables. It just sets them on the process that it starts (probably similar to Though, now that I try, it seems that Alpine's $ docker run --rm -e "variable.with.a.dot=value" eclipse-temurin:17-jdk-alpine sh -c 'exec env' | grep dot
variable.with.a.dot=value
$ docker run --rm -e "variable.with.a.dot=value" eclipse-temurin:17-jdk-jammy sh -c 'exec env' | grep dot
$ # no output ^ Looks like it was changes in busybox itself, so for a few versions of Alpine, it didn't work. I don't know if it'll break again in a future $ docker run --rm -it -e test.var=alpine busybox:1.25.0 /bin/sh -c 'env' | grep 'test.var'
test.var=alpine
$ docker run --rm -it -e test.var=alpine busybox:1.26.0 /bin/sh -c 'env' | grep 'test.var'
$ docker run --rm -it -e test.var=alpine busybox:1.27.0 /bin/sh -c 'env' | grep 'test.var'
$ docker run --rm -it -e test.var=alpine busybox:1.28.0 /bin/sh -c 'env' | grep 'test.var'
test.var=alpine |
Please add the exact image (with tag) that you are using
eclipse-temurin:11-jdk-focal
Please add the version of Docker you are running
Docker version 24.0.5, build ced0996
What happened?
Environment variables are lost and unavailable to the java process.
From the related issue in the Tomcat image:
The timing corresponds to the dependent image rebuilds caused by docker-library/official-images#15162. We haven't made changes to the Tomcat Dockerfiles since July 10.
This has the same root cause as we had in docker-library/tomcat#77.
sh
removes env vars it doesn't support (ones with periods), butbash
does not. The new entrypoint from #392 issh
on Ubuntu and Alpine images and so loses variables. Please change all the entrypoint scripts to usebash
Relevant log output
No response
The text was updated successfully, but these errors were encountered: