Skip to content

Align env_file support with docker compose (support path + required attributes) #897

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

Closed
Jiehong opened this issue Mar 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Jiehong
Copy link

Jiehong commented Mar 15, 2024

Describe the bug
Today, if one wants to use multiple env files, only a list of string is supported, but the documentation of docker compose indicates that a complex object is supported. podman compose does not support this.

To Reproduce

The following docker-compose.yml does not work:

services:
  api:
    image: "something:latest"
    ports:
      - "8080:8080"
    env_file:
      - path: defaults.env
        required: true
      - path: override.env
        required: false

Expected behaviour

podman compose takes into account defaults.env and ensure it is present, and only loads override.env if present.

Source of docker-compose documentation: https://docs.docker.com/compose/environment-variables/set-environment-variables/#additional-information

Actual behaviour
Running podman compose up api returns the following error:

>>>> Executing external compose provider "/usr/local/bin/docker-compose". Please refer to the documentation for details. <<<<

validating /Users/user/path/docker-compose.yaml: services.api.env_file.0 must be a string
Error: executing /usr/local/bin/docker-compose up --build api: exit status 15

Output

$ 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

Environment:

  • OS: Mac (untested elsewhere, but behaviour will likely be the same no matter the OS)
@Jiehong Jiehong added the bug Something isn't working label Mar 15, 2024
GerkinDev added a commit to GerkinDev/podman-compose that referenced this issue May 3, 2024
GerkinDev pushed a commit to GerkinDev/podman-compose that referenced this issue May 3, 2024
GerkinDev pushed a commit to GerkinDev/podman-compose that referenced this issue May 5, 2024
@p12tic p12tic closed this as completed in b202a09 May 6, 2024
p12tic added a commit that referenced this issue May 6, 2024
Fixes #897: support `env_file` as objects
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

1 participant