Skip to content
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

dockercompose: accept env_file argument #5462

Merged
merged 1 commit into from
Feb 8, 2022
Merged

Conversation

nicksieger
Copy link
Member

Fixes #5265.

@nicksieger nicksieger requested review from landism and nicks February 7, 2022 22:43
@@ -39,7 +39,6 @@ var dcProjectOptions = []compose.ProjectOptionsFn{
compose.WithResolvedPaths(true),
compose.WithNormalization(true),
compose.WithOsEnv,
compose.WithDotEnv,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly for my curiosity - why did this change? since you seem to add it down below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WithDotEnv function is what actually applies and reads the file and loads it into the Environment option as key-value pairs. The default filename is .env in the current directory. WithEnvFile changes the filename, but the WithDotEnv needs to follow specifying the filename in the slice of option functions to read it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicksieger nicksieger merged commit 72e16c5 into master Feb 8, 2022
@nicksieger nicksieger deleted the nicksieger/5265 branch February 8, 2022 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--env-file support for docker-compose projects
2 participants