Skip to content

Make docker-compose fail when an undefined environment variable used in a compose file. #5505

@aschatten

Description

@aschatten

Right now, if a compose file references an undefined environment variable, docker-compose prints a warning and defaults it's value to an empty string, as described here.
This may not always be the desired approach and can mask a failure in continuous deployment environment.

I think there are 2 backward compatible ways to address this:

  1. Add a option to enable strict config validation. E.g. docker-compose config --strict
  2. Add support for ${VARIABLE?err_msg} and ${VARIABLE:?err_msg} substitution syntax.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions