-
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
Updated COMPOSE_ENV_FILES in env files #12034
base: main
Are you sure you want to change the base?
Updated COMPOSE_ENV_FILES in env files #12034
Conversation
Updated the docker compose command to recursively search through any specified .env files for the COMPOSE_ENV_FILES parameter. - When found, the paths are followed recursively to extend the list of .env files used in the command. - A cache is kept that prevents circular dependencies. - Recursion is depth first. Signed-off-by: Aron Kyle <[email protected]>
👎 IMHO having an env file to declare COMPOSE_ENV_FILES demonstrates a mistake organizing config |
The situation we're trying to solve is to standardize our env files while still providing a place to put local values. i.e. we'd like to commit the .env file but optionally reference a second file that devs can use for their personal config values, something like Judging by the comments in thread in #11122 there is interest in this feature. I'm open to discussing an |
There seems to be a common issue that some config is tracked/dynamically pulled in one file, and some is managed by the user on a personal basis in a separate file (which is not tracked). Right now, Compose has no way to support this structure without changing the CLI invocation. We can't set For now, I can't use I wonder if we can settle on a "halfway" point with the following restrictions (which may help alleviate @ndeloof's concerns both here and on the linked issue):
|
Compose comes with many flags to support customization and various usages, it is expected |
Updated the docker compose command to recursively search through any specified .env files for the COMPOSE_ENV_FILES parameter.
When found, the paths are followed recursively to extend the list of .env files used in the command.
A cache is kept that prevents circular dependencies.
Recursion is depth first.
Related issue
Example fix for #11122
(not mandatory) A picture of a cute animal, if possible in relation to what you did