-
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
Error "Invalid template" parsing .env file #9746
Comments
With legacy docker-compose it is working $ docker-compose version
|
This is more of a compose issue, so I'm going to transfer it over to the compose repo to make sure they see it. |
I suspect this change was introduced in the following PR: compose-spec/compose-go#276 It seems that escaping the E.g.:
will work if converted to:
(I'm not sure if the |
I am facing the same problem. Before, this was working:
Now the only thing working is escaping the
|
I am facing the same issue with a password variable in my |
Got the same issue, noticed different behavior in mac and linux. |
I have the same issue with Docker Desktop 4.11.1 on Windows:
My
The |
The workaround is using single quotes. |
I am passing secret_key as a variable in .env file. Yesterday it was working fine, today it has started giving me Invalid template error. I did not update or change anything. |
This is fixed in v2.11.2, which has a more flexible parser and won't return errors in this situation anymore. |
Expected behavior
docker compose works as expected
Actual behavior
Error:
Invalid template: "^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?$"
Information
Output of
/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Starting diagnostics
[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0017: can a VM be started?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[PASS] DD0032: do Docker networks overlap with host IPs?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
No fatal errors detected.
Steps to reproduce the behavior
I am using a sample docker-compose file like this:
Also I have this .env file in the same directory:
As you can see, .env file is not used in docker-compose.yaml, but when I run any
docker compose
command, the error above is thrown..env file is used by another application. If I rewrite it as follows (two $ at the end), then it works for docker compose, but this is not the correct value I want to have.
Why is docker-compose forcing me to change this .env file?
The text was updated successfully, but these errors were encountered: