默认值问题
原始issue:https://github.com/docker/docker.github.io/issues/6914
官方文档:https://docs.docker.com/compose/compose-file/compose-file-v3/#variable-substitution
原文:
${VARIABLE:-default} evaluates to default if VARIABLE is unset or empty in the environment.
${VARIABLE-default} evaluates to default only if VARIABLE is unset in the environment.
${VARIABLE:?err} exits with an error message containing err if VARIABLE is unset or empty in the environment.
${VARIABLE?err} exits with an error message containing err if VARIABLE is unset in the environment.
一般情况下使用${VARIABLE:-default}就可以了
默认为空值示例: