Visitar URL original
allow optional env_file for include top level · Issue #13719 · docker/compose · GitHub
Skip to content

allow optional env_file for include top level #13719

Description

@Dialgatrainer02

Description

in #3560 optional env files are allowed at a service level https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/#additional-information

however this env file https://docs.docker.com/reference/compose-file/include/#env_file doesnt support being optional would it be possible to also make include level env_files optional using the same syntax?

Activity

  1. DaneHarrison commented on Sep 24, 2026

    @DaneHarrison
    Contributor

    I have moved onto other projects. If in the future this feature gets accepted feel free to use my draft PR (rough proposal) as a starting point.


    Proposal:

    Suggested behavior:

    • Continue supporting current behavior
    • Add optional support for format and required

    Affected repositories:

    • Compose-go
    • Compose-spec
    • Compose
      • Other projects?

    Suggested changes:

    • compose-spec: point include.env_file at the existing #/$defs/env_file definition in the schema, and document it in 14-include.md
    • compose-go: sync the schema and implement the behavior (rough draft of changes if reader was curious )
    • docker/compose: bump compose-go

    Questions:

    • IncludeConfig is an exported type so changing StringList to []EnvFile could cause issues
      • If so should this be handled in any specific way i.e marking it deprecated, adding a new/second EnvFile like property so both behaviors can be used etc...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions