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
docker compose
does not handle variable defaults in --env-file (docker-compose
does)
#8519
Comments
Although not the same result, it may be that #1892 can be related to the same .env variable handling issue. |
root cause is that the godotenv library we use to parse .env file does not support the Would need to improve https://github.com/joho/godotenv/blob/ddf83eb33bbb136f62617a409142b74b91dbcff3/godotenv.go#L330 |
internally tracked as https://docker.atlassian.net/browse/IL-393 |
I didn't see an already open ticket for godotenv so I created one joho/godotenv#153 |
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. |
This is not stale and is still an active issue in V2 of Docker Compose. |
This issue has been automatically marked as not stale anymore due to the recent activity. |
Should be fixed by compose-spec/compose-go#276 and included in the next release of Docker Compose. |
Description
Variables defaults declared in the --env-file are not passed to a compose-file.
Steps to reproduce the issue:
./foo.yml
compose-file in the project-directory./foo.env
environment fileThe Project folder should contain ...
Describe the results you received:
docker compose
fails - FOO and BAR defaults are not substituted correctly when passed intofoo.yml
docker compose
with foo.yml and declared environment variables succeedsdocker-compose
succeeds - FOO and BAR variables are passed correctlyDescribe the results you expected:
Variable defaults declared in the --env-file should be passed to a compose-file.
This works correctly when the environment variables are declared and when
docker-compose
(Python version) is used.Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:The text was updated successfully, but these errors were encountered: