-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
v2.10 expands .env file values #9806
Comments
I had the exact same issue after updating to 2.10.2. Doubling the $ did the trick. See #9704 (comment) |
I confirm this same issue related to |
I've confirmed here that adding double dollar signs, or single quotes, does prevent expansion of the variable... at the expense of modifying it. Some examples: Without any escaping: $ cat .env
FOO=$+0i
$ docker run -it --rm --env-file .env busybox env | grep FOO
FOO=$+0i
$ docker-compose ls
Invalid template: "$+0i" With double dollar signs: $ cat .env
FOO=$$+0i
$ docker run -it --rm --env-file .env busybox env | grep FOO
FOO=$$+0i
$ docker-compose ls
NAME STATUS CONFIG FILES With single quotes: $ cat .env
FOO='$+0i'
$ docker run -it --rm --env-file .env busybox env | grep FOO
FOO='$+0i'
$ docker-compose ls
NAME STATUS CONFIG FILES Note that while this doesn't use |
I have same problem in docker desktop 4.12 |
^http://localhost:[0-9]+ -- try this |
This is fixed in v2.11.2 - the parser is now more flexible and won't error out in this situation anymore.
Running
For situations like this, I would recommend using single quotes to prevent any unintentional interpolation - see #9879 for details. |
Related to issue #9704.
I have a php symfony framework with .env file and config params inside. There I have row:
CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$
when I'm trying to build using docker-compose I can see error: Invalid template: "^https?://localhost(:[0-9]+)?$"
docker-compose v2.10.2 (Linux Standalone binary), docker 2.10.17
The text was updated successfully, but these errors were encountered: