Skip to content

Conversation

kamermans
Copy link

Signed-off-by: Steve Kamerman stevekamerman@gmail.com

Resolves #2854

This PR adds support for environment variables in .env files with quoted values. The quotes can be single ' or double ", but must be the same on both ends of the value, and must immediately follow the =.

Example:

MYVAR="this is a test"

It also unescapes escaped quotes, like \":

MYVAR="this is a \"quoted\" test"

Value: this is a "quoted" test

All functionality is tested.

This problem has been thoroughly discussed in issue #2854 and there are many reasons for why docker-compose should support this.

Signed-off-by: Steve Kamerman <stevekamerman@gmail.com>
@kamermans
Copy link
Author

I understand that this change will also affect the documentation, so I'm happy to put in a PR for that as well.

@kolaente
Copy link

kolaente commented Dec 2, 2019

Ping @ulyssessouza @ndeloof @rumpl Any chances this will be merged?

@ulyssessouza
Copy link
Collaborator

The PR was closed in favor of the adoption of python-dotenv that solves the problem in a more general way. But anyways, thank you @kamermans !

@feld
Copy link

feld commented Oct 21, 2022

I don't know how python-dotenv solves this issue that remains as seen in #2854 (comment) ???

Can anyone clarify?

edit: I think this PR is from before docker-compose was rewritten in Go

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.

Inconsistent env var parsing from docker-compose.yml
4 participants