-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
Description
We still have a problem with different parsing of env files in docker compose and docker run
Files:
.env.test
TEST_VAR='{"key": "value"}'test.Dockerfile
FROM ubuntu
CMD echo "$TEST_VAR"test.docker-compose.yaml
services:
service:
build:
dockerfile: test.Dockerfile
env_file: .env.test
image: test-imageExecution:
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)