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
dockerfile specification for unsetting environment variables. #9298
Comments
UNSET seems like it could help for the case of inheritance, i like that, but in my dockerfile i want to communicate the intent of a default value that can be overridden at run time with a --env option from whats provided in the Dockerfile. In this case the default I want is an empty string but empty string values don't seem to evaluate correctly in bash. Will UNSET still list the variables being managed in the Dockerfile at the command line? |
Unset will (as proposed, it's not yet merged), basically "remove" the If you need more help, perhaps it's better to ask for support on IRC or Google Groups, because the GitHub issue tracker is not the best place for support questions. You can find them on this page; https://docker.com/resources/help/ |
@thaJeztah Yep, I agree with that approach. I'll close this and look for UNSET feature. |
Thanks! And now hope the |
+1 for UNSET |
+1 |
+2! |
+1 sometimes it is mandatory, e.g. when developing container behind proxy |
Could we consider reopening this, in light of #3465 being closed? My specific usecase is needing to set a specific environment variable ( (Syntaxwise, I imagine related and discusses specific need: ... ENV DEBIAN_FRONTEND nointeractive |
@scraperdragon I know its not the same thing as unsetting it, but would setting the var to "" help? |
@duglin it may or may not help in this specific case (I have no idea what setting okfn/messytables@166f89a shows the particular case in point |
yea I know, was just hoping to might give you some immediate relief |
Why not |
Due to moby/moby#9298 it is a huge pain to remove ENV vars when composing images, allow us to simply treat "blank" as a ENV var that is not being shadowed. In general we always supply a value to ENV vars we are shadowing.
@thaJeztah does this works with P.S: I am confused about it, the |
@yordis correct, build args are only available during build, however, depending on what unused them for, their value may still end up an image, e.g.
|
I have a mandatory requirement for UNSET - you see, the silly upstreamers set an environment variable which breaks my builds, and setting it to empty string ( +1 |
Does anyone have an idea is this is going to be implemented anytime soon? |
@haizaar see #3465 and #3465 (comment) |
I want to be able to have a default setting for environment variables in my Dockerfile that cause the env value for a value to not be set when you don't pass --env. Can ENV be improved to support this or give ENV a way to specify an empty string?
case 1 :
ENV foo "" will result in a bash test like if [ -z $ENV ] ; to be false. this is because the value for foo is actually being stored as '""'
Please provide some syntax so that [ -z $FOO ] can be true.
Thanks!
The text was updated successfully, but these errors were encountered: