-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to set environment variables in the container #890
Comments
One workaround for now would be to build your own custom base image that preloads the environment variables you want and make Jib point to that base image. (Jib will propagate the env vars in the base image when building an image (#595 (comment)).) |
Ok thanks, any idea when that feature might be added and when 0.9.10 is likely to be released? |
@matt-shaw |
@matt-shaw 0.9.10 has been released with labels support. We were also wondering why you'd like to set environment variables through the plugin at build time rather than during deployment? |
We change the behaviour of the spring boot application using environment variables. Some of these variables are set when the app is run via docker and others when it’s run as a stand-alone java app. To be honest it’s also in the docker spec so would be nice to be able to set them. We use the alpine-jre base image. |
That's an interesting use case and we're currently discussing adding this in because it's in the docker spec.
|
No, it’s not really runtime dependent, more build time, I.e. it’s set because it’s run in docker and doesn’t change at runtime. |
@matt-shaw We have released version |
Hey @coollog. Thanks a lot for making that nice tool! But have u tested the
And after executing |
Hi @dzmitryh , thanks for catching this bug! Looks like we did not attach the ENV generator to the docker context goals/tasks. We will definitely add this in and release a fix in version |
Update: the docker context problem has been fixed and will be available in v0.9.13 (already released for Gradle, working on Maven and should be released either later today or tomorrow). |
jib-maven-plugin 0.9.11->0.9.13 See GoogleContainerTools/jib#890 (comment)
@dzmitryh |
Using the maven plugin. How can I set environment variables within the container?
Also, when is 0.9.10 likely to be released as I need the label feature?
The text was updated successfully, but these errors were encountered: