Skip to content

--env-file option does not match docker-compose's behavior #847

@thomas-huegel

Description

@thomas-huegel

Describe the bug
docker-compose searches the env file relatively to the working directory.
podman-compose searches the env file relatively to the directory containing the docker-compose.yml passed via the -f option.

To Reproduce
docker-compose.yml:

version: "3"

services:
  example:
    image: busybox
    environment:
    - FOO=${FOO}
    command: >
      sh -c '
        set | grep FOO
      '

env-files/my-env:

FOO=foo

This works for docker-compose and not for podman-compose:

cd env-files
docker compose --env-file my-env -f ../docker-compose.yml up 
podman-compose --env-file my-env -f ../docker-compose.yml up 

This works for podman-compose and not for docker-compose:

cd env-files
docker compose --env-file env-files/my-env -f ../docker-compose.yml up 
podman-compose --env-file env-files/my-env -f ../docker-compose.yml up 

Expected behavior
I would expect podman-compose to behave the same way as docker-compose.

Environment:

  • OS: Linux
  • podman version: 4.9.2
  • podman compose version: 1.0.6

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions