Skip to content
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

Merged
merged 1 commit into from
Jan 20, 2015

Conversation

thaJeztah
Copy link
Member

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.

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>
@jamtur01
Copy link
Contributor

LGTM Ping @SvenDowideit @fredlf

@SvenDowideit
Copy link
Contributor

LGTM

SvenDowideit added a commit that referenced this pull request Jan 20, 2015
Document that ENV vars are not automatically updated
@SvenDowideit SvenDowideit merged commit 04d1b93 into moby:master Jan 20, 2015
@thaJeztah thaJeztah deleted the docs-note-environment-vars branch January 20, 2015 07:04
@thaJeztah
Copy link
Member Author

Thanks!

SvenDowideit added a commit to SvenDowideit/docker that referenced this pull request Jan 27, 2015
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)
@mikehaertl
Copy link

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:

You can use these environment variables to configure your applications to connect to the database on the db container.

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?

@thaJeztah
Copy link
Member Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants