Docker compose >=2.24.0 env_file syntax #102

Open
opened 2024-12-21 09:54:28 +00:00 by GSergeevich · 2 comments
GSergeevich commented 2024-12-21 09:54:28 +00:00 (Migrated from github.com)

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
Hi! The docker compose since version 2.24.0 has a [new syntax](https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/#additional-information-1) > 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 commented 2024-12-21 10:35:14 +00:00 (Migrated from github.com)

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

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

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Katenary/katenary#102
No description provided.