-
Notifications
You must be signed in to change notification settings - Fork 568
Description
Is your feature request related to a problem? Please describe.
I'm always frustrated when I cannot use recursive variable substitution in .env files with podman compose. Unlike Docker Compose, podman compose does not support resolving variables defined in terms of other variables within the .env file. For example, defining A=Hello and B=${A} World results in B being interpreted literally as ${A} World instead of Hello World. This forces redundant definitions and violates the DRY principle, making environment configuration error-prone and harder to maintain.
Describe the solution you'd like
podman compose should fully support variable interpolation in .env files, including recursive and default-value syntax (e.g., ${VAR} and ${VAR:-default}), consistent with Docker Compose behavior. This would allow clean, modular configuration where variables can be defined once and reused, improving readability and reducing duplication.
Describe alternatives you've considered
Currently, I work around this by:
- Using external tools like
envsubstor custom shell scripts to pre-process.envfiles. - Duplicating values across the
.envfile, which increases maintenance effort and risk of inconsistency. - Explicitly using interpolation in the
compose.yaml(e.g.,ENV_VAR: ${ENV_VAR}), which forces changes in the compose file and reduces portability.
These workarounds are non-standard, add complexity, and break compatibility with Docker Compose workflows.
Additional context
This issue is well-documented in the community (e.g., Issue #718, Issue #1064) and represents a deviation from Docker Compose's expected behavior. Supporting full .env interpolation would improve compatibility, usability, and adherence to established container orchestration practices.