-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Environment Variables Not Being Passed to Containers Properly #2332
Comments
This was the only breaking change in 1.5.0 (unfortunate, but there wasn't really any way around it). The release notes include a warning about it. You can escape the So |
Although, I think in your case, you could also use the link name? environment:
DATASTORE_URL=http://etcd:2379
KUBERNETES_URL=http://kubernetes:8080 |
Interesting. I'll have to give that a shot. Why was the new behavior required? It doesn't seem like it's actually of use unless you need to pass through values (which doesn't seem like a case that would come up very frequently). The release notes also indicate that only specific fields are affected by this change (see quote below). Is it a bug that environment variables are also affected by this?
|
Support for variables in the Compose file was one of our most requested features. It allows users to customize the compose file for different users or environments without having to edit the file directly.
That's my fault. We expected that the only place users would have existing environment variables for the container would be the It's not a bug, every field now supports variables. |
@dnephin Can you provide a summary or links to the requests with use cases for the interpolation? I'm curious as to how people will be using this feature (in case we want to integrate those strategies). |
The PR is #1765, there are ~15-20 linked issues, most of which talk about use cases. |
For future reference, using the service name in the docker-compose file does not work. Also, using the link variables doesn't appear to actually link containers anymore. Is there more information that must be passed with the new docker-compose (or docker-1.9.0) to ensure that links work as written? |
Using the project name as an environment variable works, as long as you set it in the host environment. Links are networking are different implementations and they don't work together. If you use |
@dnephin where do I pass Are you suggesting that the docker link mechanism is deprecated and using the given environment variables provided by linking will go away? I'm probably just reading your statement incorrectly. |
http://docs.docker.com/compose/env/ http://docs.docker.com/compose/compose-file/#links or both set the hostname (but unfortunately to different things right now #2312) |
As of docker 1.10 these Use the hostname provided by links (in |
I use environment variable declarations like the following:
With compose-1.5 this seems to pass through empty strings:
How do we get the correct behaviour of passing these variables through as written (without any needless mangling)?
This breaks our ability to use compose to deploy testing environments that function correctly.
The text was updated successfully, but these errors were encountered: