-
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
Feature Request: option to disable reading from .env #6741
Comments
Hi @jonmchan, Thanks for your report. I would prefer to keep issues in the same place so that we can track them. Could you please add this as a comment to the relevant issue? I'll close this as a duplicate. |
hi @chris-crone , this isn't a duplicate. This is a feature request to disable reading I think evaluating this feature request independently - "can we have a config option to disable interpreting |
Thanks for clarifying @jonmchan I'll reopen this. |
I started looking into the details for implementing such a feature - the |
Definitely in favour of being able to disable |
.env is such a standard outside of docker, allowing docker to dictate to me how I should be using it and given I'm not even using it to configure docker itself I feel its a complete overreach by docker. Thank you for this feature, I hope it gets merged soon. |
Docker just broke my development environment too. :( As a Python developer I use
This allows me to simply We need a way to disable this behavior or at a minimum have it give a warning and keep going because my |
Fixes docker#6741 Updates docker#6511
Fixes docker#6741 Updates docker#6511
Fixes docker#6741 Updates docker#6511 Signed-off-by: Hiroshi Ioka <[email protected]>
This is massively frustrating team! The change will have made these tools unusable in people's dev environments :( |
Everyone please comment on PR #6850. I don't think it properly addresses this issue, but I would love to get everyone else's feedback. Thanks! |
A work-a-round that is essentially the same as a
|
Seems the /dev/null workaround stopped working after new update (https://docs.docker.com/compose/release-notes/#1286) |
Still experiencing this issue. Docker compose is reading from whatever context it is given and automatically sources the .env. Any tooling is appreciated to navigate this. |
Kindly request comments and help on my proposed PR #8322 to fix this issue. This PR would read the docker-compose.yml file an additional time looking for an |
The smoke test broke in CI as the app won't start without the ORCID client ID set. This sets a dummy value so that it can, thought the functionality won't work. This wasn't caught locally as I have a local .env file, which sees different environment variables passed to the application. There's no option for not reading from a .env file (docker/compose#6741), so running the smoke test locally could see different behaviour. Refs #390
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still missing a solution for the problem. No updates. But let's make the bot happy. Sorry for the spam. |
This issue has been automatically marked as not stale anymore due to the recent activity. |
Quick and dirty workaround: |
Same thing with my current v2.7.0
when run this container |
absolutely needed feature. .env vars cannot be overriden even with services.app.environment or services.app.env_file and |
Still needed feature as
and the following
|
It takes half a day for me to find out why compose doesn't work, such annoying. |
This has affected our development as well. We have .env vars used for purposes other than docker-compose. It is surprising to me that I cannot disable this check. We have .env files setup that are wrapped in brackets: {} This breaks all docker compose command because of this. We should be able to disable OR make the add --env-file to every docker-compose command is not an adequate solution in my opinion. I am actually trying to figure out where in the code the .env is being added prior to calling: compose/cmd/compose/compose.go Line 526 in 328ca3f
As I am not sure why we cant set the If someone can point me to the line where this is occurring, I will update and add tests to fix. I will try to find it again tomorrow. |
Yep - this is still a problem that has been open for >4 years... Similar to everyone else, I have a .env file that contains all the config for my application and no matter what I set it will not route to an alternative env file. As of v2.23.0 it seems that even passing The only thing I can think of which seems to work is to have a sub folder in my project called |
@ajfisher use of |
Similar/repeat request to #4642. New/different reason now though. Related to #6511.
Other systems use the exact same file
.env
for parsing and processing environment variables. With the release of 1.24.0, the feature whereCompose will no longer accept whitespace in variable names sourced from environment files. This matches the Docker CLI behavior.
breaks compatibility with other .env utilities. Although my setup does not use the variables in .env for docker-compose, docker-compose now fails because the .env file does not meet docker-compose's format.I either have to make the .env file fit docker-compose's format or remove the file.
I propose that you can specify an option to ignore the
.env
file or specify a different.env
file (such as.docker.env
) in thedocker-compose.yml
file so that we can work around projects that are already using the.env
file for something else.The text was updated successfully, but these errors were encountered: