-
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
Change in the way quotes in env files are treated #8388
Comments
The way |
This changes from using a custom parser to using the dotenv library. I think the new behavior is better, but it appears to be labeled a "bug fix" in the changelog, and not called out as a breaking change. To be fair, it is a departure from @ndeloof are you using an old version of docker-compose? I read this issue wrong the first time. The "expected result" is that it carries the quotes to the environment variable, and the actual result is that it gets rid of the quotes, which is what I've come to expect. It does this by using the dotenv library. |
With Docker Compose 2.0 on the way, it's good that this change already been made, so 2.x can have one fewer breaking changes. |
The current docs are incorrect
...should be changed to something like:
|
Unfortunately, dotEnv is only a de facto standard, with no precise definition. For sample, Python dotEnv doesn't behave exactly the same as Ruby dotEnv. Docs is indeed incorrect, I have a pending PR to make this change more visible: https://github.com/docker/docker.github.io/pull/13474/files#diff-8edc9c85338bc8e7c7a80ef3a0a01ec54cfad9e2ac61824e40c42c66604c3355 |
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 issue has been automatically closed because it had not recent activity during the stale period. |
See docker/compose#8388 Before this version, docker-compose would pass env variables verbatim, VAR='val' -> 'val' Newer versions do: VAR='val' -> val Fix .env file to work for both. Thanks Anel <[email protected]> for the initial PR.
Description of the issue
The way docker-compose treats quoted values in env_files has changed. The documentation says:
But now if the value is quoted the container sees the unquoted value. This means that the same env file provided via
docker run
anddocker-compose
will give different environment variables inside the container.Context information (for bug reports)
Output of
docker-compose version
Output of
docker version
Steps to reproduce the issue
Observed result
Expected result
Additional information
The commit which has caused the regression seems to be 6d2658e.
The text was updated successfully, but these errors were encountered: