-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Unable to override environment variables if they are present in .env files #9737
Comments
This has been broken as of |
This is the new expected behaviour. Environment file now has precedence over the OS Environment.
The |
Thanks for the clarification @ulyssessouza . Just wondering, but why the sudden change in behaviour? IME, it's counter-intuitive to how most other tools and libraries handle env vars. |
First you broke the ability to pass in ENVs to compose as a regression #9495, so we started using |
Just to clarify, from what I can see |
@madhavajay No, I've built both |
It broke my CI/CD |
Being a breaking change it should have been done in a major (e.g 3.0.0) release. |
This was a deliberate breaking change that changes the behavior of a component which is being used in the same way for years and as you said @yanneg, it goes against expected behavior of most other tools and libraries. |
That was me trying to give more flexibility to
I would like to thank you all for the feedback and present my excuses for the inconvenient. It was in the best intentions of evolving the software. I'm working on a PR and a patch release to revert that behaviour. Also a better documentation on precedence is being cooked. |
@ulyssessouza awesome. Thank you for your prompt action on this issue. |
@ulyssessouza thanks so much for listening. I think everyone here can agree, the tooling is great, we love docker, we love docker compose, so much so were building our tooling on it, which is why were here quickly googling why our stack has broken. I personally noticed this on I also think that considering docker wants to accelerate adoption of new versions its extra important that regressions don't get introduced because users are being actively encouraged to upgrade so we should expect regressions to have large Having said that, please do keep innovating. ❤️ |
Description
v2.9.0 does not allow environment variables to be overridden if they are already present in
.env
.Steps to reproduce the issue:
docker-compose.yml
:And
.env
APP_CONTAINER_TAG=foo PROXY_CONTAINER_TAG=foo ./docker-compose-2.9.0 convert
, I receive the followingIn versions prior, like
2.7.0
, I would get the expected behavior:Output of
docker compose version
:Additional environment details:
I noticed this on my GitHub Actions environments. The runner recently updated Docker Compose to v2.9.0.
The text was updated successfully, but these errors were encountered: