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

Docker compose >=2.24.0 env_file syntax #102

Open
GSergeevich opened this issue Dec 21, 2024 · 2 comments
Open

Docker compose >=2.24.0 env_file syntax #102

GSergeevich opened this issue Dec 21, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@GSergeevich
Copy link

Hi!

The docker compose since version 2.24.0 has a new syntax

As of Docker Compose version 2.24.0, you can set your .env file, defined by the env_file attribute, to be optional by using the required field. When required is set to false and the .env file is missing, Compose silently ignores the entry.

env_file:

  • path: ./default.env
    required: true # default
  • path: ./override.env
    required: false

so

katenary convert docker-compose.yml
validating docker-compose.yml: services.portal.env_file.0 must be a string
@GSergeevich
Copy link
Author

As I discovered, support for the new syntax was added to the compose-go library in release 2.0.0:
https://github.com/compose-spec/compose-go/releases/tag/v2.0.0

@metal3d metal3d added the enhancement New feature or request label Dec 28, 2024
@metal3d metal3d self-assigned this Dec 28, 2024
@metal3d
Copy link
Owner

metal3d commented Dec 28, 2024

Thanks for your report.

I will need to update the compose-go package, which isn't compatible with the previous package. And the entire Katenary codebase uses the definition.

I will try to use the v2 in a few days.

metal3d added a commit that referenced this issue Dec 28, 2024
As explained in #102, the compose-go package changes types and needs
massive changes.
This branches is OK for now, but needs some tests.
It MUST be quickly fixed to be integrated in main branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants