-
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
Inconsistent handling of quoted variables in .env between Compose v1 and v2 #8740
Comments
@ndeloof |
I would like to point out that this goes directly against the environment file spec at https://docs.docker.com/compose/env-file/ One of the syntax rules mentioned there is:
|
Yes, doc need to be updated for V2, see 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. |
Brief description:
Quotes in
.env
files aren't handled the same way between Compose v1 and Compose v2.Specifically, with Compose v2, variables with spaces must be quoted, otherwise, they get truncated.
In Compose v1, in remember that in one case, I had to remove the quotes, because they would show up in the variable (but I can't reproduce that issue right now so it might be specific to some older versions of Compose v1?)
Steps to reproduce the issue:
Create the following files:
Then
docker-compose up
.Describe the results you received:
With Compose v1, both variables are fully present:
With Compose v2, the variable without quotes is truncated:
Describe the results you expected:
Identical result with both versions of Compose.
Output of
docker compose version
:Similar or related issues:
This could be related to #8626 (which is also about an env issue) but it might also be a different bug, so I'm opening a separate issue.
The text was updated successfully, but these errors were encountered: