containers / containers/podman-compose

env_file: does not match docker-compose's behavior

Open
#848 3 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
`docker-compose` implicitely uses the `.env` file to populate variables contained in the file passed to `env_file`, whereas `podman-compose` does not.

**To Reproduce**
.env:
```
BAR=bar
```
.foo:
```
FOO=$BAR
```
docker-compose.yml:
```
version: "3"

services:
example:
image: busybox
env_file: .foo
command: >
sh -c '
set | grep FOO
'
```

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

**Actual behavior**
```
docker compose up
example-1 | FOO='bar'

podman-compose up
[example] | FOO='$BAR'
```

**Environment:**
- OS: Linux
- podman version: 4.9.2
- podman compose version: 1.0.6

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.