Skip to content
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 v2.29.7 'unexpected character "-" in variable name' when passing .env #12216

Closed
daraccrafter opened this issue Oct 16, 2024 · 3 comments
Assignees
Labels

Comments

@daraccrafter
Copy link

daraccrafter commented Oct 16, 2024

When passing .env file (in which a variable name contains '-') to the " env_file:" (in compose.yml) the above error occurs. This works normally on v2.24.5

@jhrotko jhrotko self-assigned this Oct 16, 2024
@jhrotko
Copy link
Contributor

jhrotko commented Oct 16, 2024

@daraccrafter could you give more details on how to reproduce your issue? Such as a compose.yml and how you ran the command?

@426Mopar
Copy link

I'm having the same problem. The problem is with the .env definitions.
I have names defined with the "-" hyphen, which worked before, but if I'm not mistaken not allowed in bash.

.env example:

...
APPLICATION-FOO-KEY=123456789
...

when I changed it from APPLICATION-FOO-KEY to APPLICATION_FOO_KEY docker compose worked, of course my application doesn't work anymore, since it expects APPLICATION-FOO-KEY but that is another problem.

@jhrotko
Copy link
Contributor

jhrotko commented Oct 17, 2024

@426Mopar @daraccrafter this issue has been addressed in #12123. In the next release this should be fixed! I will close this issue has duplicated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants