Skip to content

Env files parsing #12174

@present-g

Description

@present-g

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-image

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions