Skip to content

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

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.

Activity

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions