Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env_file: does not match docker-compose's behavior #848

Open
thomas-huegel opened this issue Feb 17, 2024 · 2 comments
Open

env_file: does not match docker-compose's behavior #848

thomas-huegel opened this issue Feb 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@thomas-huegel
Copy link

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!

@thomas-huegel thomas-huegel added the bug Something isn't working label Feb 17, 2024
@muayyad-alsadi
Copy link
Collaborator

$ docker-compose --version
docker-compose version 1.27.4, build unknown
$ docker --version
Docker version 20.10.12, build e91ed57
$ docker-compose up
Creating envtest2_example_1 ... done
Attaching to envtest2_example_1
example_1  | FOO='$BAR'
envtest2_example_1 exited with code 0

it matches podman-compose

and this is well-documented

The value of VAL is used as is and not modified at all. For example if the value is surrounded by quotes (as is often the case of shell variables), the quotes are included in the value passed to Compose.

@thomas-huegel
Copy link
Author

thomas-huegel commented Feb 19, 2024

No, it does not, at least on my environment.

➜  docker-compose --version 
Docker Compose version 2.24.6
➜  docker --version
Docker version 25.0.2, build 29cf629222
➜  podman-compose --version 
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.9.3
podman-compose version 1.0.6
podman --version 
podman version 4.9.3
exit code: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants