-
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
Inline comments in .env
#9025
Comments
I am experiencing the same issue, with However I admit that the documentation describes comment as "Lines beginning with #". It was convenient though 😕 |
This should be resolved with compose-spec/godotenv#14 |
Thanks @ulyssessouza for the info and making the pull request. Sorry, I'm not familiar with how the project is organized. I was not able to find which version might be including the pull request. Would you happen to know what docker compose version will be including this pull request? Thanks again 🙏 |
@zhao-li in the next one. Can be a |
Thanks @ulyssessouza for the versions. I can't wait to test it out 🦦 |
Seems like this issue happens again in Docker Compose 2.19.0. I have this
And here are some lines of
They are transformed into environment variables with values |
Hm... I get this error only on GitHub Actions. I don't get it when testing locally. |
Seems like I've got a bit confused with my tests -- the problem is not in |
@LeviPesin docker CLI does not rely on compose's dotenv file parser, but read .env file as a raw KEY=VALUE file without support for comments nor quoted content |
Thanks! I will file an issue on the Docker CLI's repo then. |
@LeviPesin you can, but don't expect this to change as this would break backward compatibility. dot env is a de facto, informal file format with no established definition, so no surprise "features" used in this format are not homogeneous between ecosystems |
Description
Inline comments in my
.env
file used to be ignored properly, but now they are getting sucked intodocker-compose.yml
configurations and is causing errors.Is this a new feature or the expected behavior going forward? I couldn't find anything new in the documentation.
Thank you for any help or guidance 🙏
Steps to reproduce the issue:
docker-compose build
Describe the results you received:
Docker Compose errors out with:
Describe the results you expected:
The container should get built/pulled properly.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker compose version
:Output of
docker info
:Additional environment details:
docker-compose.yml
:.env
:The text was updated successfully, but these errors were encountered: