You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It has a minimal example of a service (top) which extends another (common), both of which use env_file and environment. There are four env variables, and I'd expect one to be set from each source.
The gist includes output from different compose versions, starting at 1.4.2.
In 1.4.2 and 1.5.0 the output is consistent, but TEST_TWO comes from the top env_file. I would have expected it to come from common, because environment always overrides env_file.
In 1.5.1 (and in #2418) the output is consistent. TEST_TWO is now set by common (which is a change, but what I would expect), but TEST_TREE (just noticing the typo now) is set by common env_file. I would expect it to be set by top env-file. I believe this issue is about this case.
We need to also make sure that the change in behaviour from 1.5.0 to 1.5.1 is expected and matches our documentation.
doesn't recreate the container if you make changes in top.env
I believe the hash is only going to calculate changes based on the resolved environment variables. So if you make a change that results in the same key/value pairs, it won't result in a recreate.
I added a new environment variable to top.env and it did trigger a recreate. Maybe there's some other edge case?
Activity
dnephin commentedon Nov 23, 2015
I've created this gist: https://gist.github.com/dnephin/447b293cfca7099822d0
It has a minimal example of a service (top) which extends another (common), both of which use env_file and environment. There are four env variables, and I'd expect one to be set from each source.
The gist includes output from different compose versions, starting at 1.4.2.
In 1.4.2 and 1.5.0 the output is consistent, but
TEST_TWOcomes from the top env_file. I would have expected it to come from common, because environment always overrides env_file.In 1.5.1 (and in #2418) the output is consistent.
TEST_TWOis now set by common (which is a change, but what I would expect), butTEST_TREE(just noticing the typo now) is set by common env_file. I would expect it to be set by top env-file. I believe this issue is about this case.We need to also make sure that the change in behaviour from 1.5.0 to 1.5.1 is expected and matches our documentation.
dnephin commentedon Nov 23, 2015
I've got a branch (master...dnephin:fix_env_file_ordering) which fixes this to do what I would expect. It's based off the work in #2405
@aanand, @shin- does the above sound right?
krasi-georgiev commentedon Nov 23, 2015
now the ordering for the env_file is fine , haven't tested the environment one
another problem
docker-compose --x-networking up -d top - doesn't recreate the container if you make changes in top.env
dnephin commentedon Nov 23, 2015
You mean with the branch I linked?
I believe the hash is only going to calculate changes based on the resolved environment variables. So if you make a change that results in the same key/value pairs, it won't result in a recreate.
I added a new environment variable to
top.envand it did trigger a recreate. Maybe there's some other edge case?krasi-georgiev commentedon Nov 23, 2015
yes I tested the new branch you created
and you are 100% right it does trigger the recreate properly
so this definitely solves my case