Skip to content

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Dec 21, 2022

closes docker/compose#9980

illustration example:

$ cat compose.yml 
services:
  test:
    image: alpine
    command: sh -c "env"
    env_file:
      - "base.env"
      - "extra.env"
$  cat base.env 
FOO="expected"
$  cat extra.env 
FOO="${FOO:-default}"
$  docker compose run test | grep FOO
FOO=expected

@ndeloof ndeloof requested review from glours and ulyssessouza and removed request for glours December 21, 2022 09:05
…s files in the list

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🥳

@ndeloof ndeloof merged commit 4c5c833 into compose-spec:master Dec 22, 2022
@ndeloof ndeloof deleted the environment branch December 23, 2022 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] interpolation (or basic variable substitution) not working across multiple env_file (from the top to the bottom of the list, as expected)
2 participants