Skip to content

Conversation

@mokibit
Copy link
Collaborator

@mokibit mokibit commented Jun 25, 2025

This commit allows compose file to directly use environment variable values in environment: section when variables were set in .env file. This functionality was missing, as docker-compose supports both: short and variable interpolation syntax forms, in compose.yml file:

environment:
    - FOO

and

environment:
    - FOO=${FOO} 

Relevant docker-compose documentation:
https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/
podman-compose is more compatible with docker-compose after this change.

This pull request solves issues: #491, #1011, #1160.

@mokibit mokibit force-pushed the add-short-syntax-for-env-variables branch 5 times, most recently from 222c088 to 13288d3 Compare June 26, 2025 09:28
This commit allows compose file to directly use environment variable
values in "environment:" section when variables were set in `.env` file.
This functionality was missing, as docker-compose supports both: short
and variable interpolation syntax forms:
environment:
	- FOO
and
environment:
	- FOO=${FOO}
Relevant docker-compose documentation:
https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/
podman-compose is more compatible with docker-compose after this change.

Signed-off-by: Monika Kairaityte <[email protected]>
@mokibit mokibit force-pushed the add-short-syntax-for-env-variables branch from 13288d3 to 0cbf70a Compare June 26, 2025 09:40
@p12tic p12tic merged commit b48317c into containers:main Jun 26, 2025
8 checks passed
@mokibit mokibit deleted the add-short-syntax-for-env-variables branch June 26, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants