You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docker Compose .env file parser is not strictly equivalent to the one used by docker run, because the former manages variable interpolation while the latter just consider values as raw string, including quotes.
There's no workaround for this. A possible fix would be to give you an option to explicitly request env file to be loaded without compose to manage values:
services:
service:
env_file:
path: .env.testformat: raw # default is to parse with interpolation
Docker Compose .env file parser is not strictly equivalent to the one used by docker run, because the former manages variable interpolation while the latter just consider values as raw string, including quotes.
And that's the issue. Docker's primary goal is to ensure that everything runs consistently across all environments.
format: raw - is it working now? I've never seen that before
We still have a problem with different parsing of env files in
docker compose
anddocker run
Files:
.env.test
TEST_VAR='{"key": "value"}'
test.Dockerfile
test.docker-compose.yaml
Execution:
docker compose -f test.docker-compose.yaml up --build
=>{"key": "value"}
docker run --env-file .env.test test-image
=>'{"key": "value"}'
We need unified results, otherwise, apps may not work correctly
Docker version 27.1.1, build 6312585
Docker Compose version v2.29.1-desktop.1
Originally posted by @present-g in #2854 (comment)
The text was updated successfully, but these errors were encountered: