-
Notifications
You must be signed in to change notification settings - Fork 252
"invalid template" error from certain YAML comments #1896
Comments
I can't reproduce this error with 2.0.0-beta.6, but it seems this is caused by variable interpolation to inadequately apply inside comments. Variable substitution is currently implemented as plain string replacement on compose file content. |
internally tracked as https://docker.atlassian.net/browse/IL-395 |
The mention above with the fix at https://github.com/alan-turing-institute/AutSPACEs/pull/132/files hinted at me that dollar signs |
It seems this bug got re-introduced in https://github.com/docker/compose as I use version 2.9.0 and observe the same behavior with dollar signs in a .env file |
I tested and both the double sign and the quotes are working. Thank you! |
Seeing the same issue here with |
I agree just adding my variable into quote fixed the issue 🎉 I think it's a regression 🤔 BeforeENV=env_value$ AfterENV='env_value$' |
I am seeing the same issue on Linux with |
Guys, I had the same issue today with such code in I have fixed it like this and docker-compose started to work: So I hope you all can use this solution, just make it an escape character with backslash P.S Docker Compose version v2.10.2 |
thanks for your answer. |
@ndeloof I think we should reopen this issue or create another one |
Same issue here, if you have installed the CORS extension from Symfony, they have wildcards in env. Delete it, fixing, really. |
For mine, I wrapped the entire defaulting string in single quotes and it worked |
Can confirm this issue occurs when using a dollar sign in any value in You can fix this by wrapping the value in single quotes. Wrapping the value in double quotes doesn't fix it. |
See docker/compose#9746 for more - appears resolved in version 2.11.2 |
Description
A previously valid docker compose file started raising an error with docker compose v2. I that noticed a possibly similar issue was raised a few days ago in a public project.
My workaround was to revise the text in my YAML comments in the place where comments described a command.
Note, this is only with Docker Compose v2, I didn't encounter any errors using docker-compose v1.29.
Results of my quick experimentation with YAML comments:
Steps to reproduce the issue:
# $1
.docker compose -f docker-compose.yaml config
Describe the results you received:
Describe the results you expected:
The previously valid file continues to be valid.
Additional information you deem important (e.g. issue happens only occasionally):
n/a
Output of
docker compose version
:This is the version where I'm encountering the errors.
And docker-compose --version, just FYI, no errors running the same file with this:
Output of
docker version
:Output of
docker context show
:You can also run
docker context inspect context-name
to give us more details but don't forget to remove sensitive content.Output of
docker info
:Additional environment details (AWS ECS, Azure ACI, local, etc.):
Only tested local.
The text was updated successfully, but these errors were encountered: