-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Document that ENV vars are not automatically updated #10170
Document that ENV vars are not automatically updated #10170
Conversation
Unlike the entries in `/etc/hosts`, environment-variables for linked containers are not automatically updated if the linked container is restarted. This adds a note to the documentation in; https://docs.docker.com/userguide/dockerlinks/#environment-variables and https://docs.docker.com/reference/run/#env-environment-variables To make users aware that this is the case and recommends them to use the `/etc/hosts` entries in stead. I added this change because users were expecting environment variables to be updated automatically as well (moby#10164). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
LGTM Ping @SvenDowideit @fredlf |
LGTM |
Document that ENV vars are not automatically updated
Thanks! |
Document that ENV vars are not automatically updated (cherry picked from commit 04d1b93) Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@users.noreply.github.com> (github: SvenDowideit)
Thanks for adding this note, I didn't know that. But now I wonder, if the docs aren't contradictory in some way. Because in the next paragraph it says:
I think this recommendation no longer holds true, right? Actually I wonder, what use those env variables are anyway, if you can't really rely on their content. Shouldn't they be removed completely and marked as deprecated in the manual? |
The environment variables predate the host entries and, yes, they don't offer very much because (for example) you need to know the port number of the service in order to find its IP-address. It's likely the environment vars will disappear in the future. Some people prefer env-vars, however (it's a common way to pass configuration settings) and to stay backwards-compatible, they cannot be removed (at least not until Docker 2.0, whenever that is). |
Unlike the entries in
/etc/hosts
, environment-variables for linked containers are not automatically updated if the linked container is restarted.This adds a note to the documentation in; https://docs.docker.com/userguide/dockerlinks/#environment-variables and https://docs.docker.com/reference/run/#env-environment-variables to make users aware that this is the case and recommends them to use the
/etc/hosts
entries in stead.I added this change because users were expecting environment variables to be updated automatically as well (#10164).
NOTE;
I decided not to add a note to the brand-new know issues section; let me know if that is desired.