Skip to content

keep empty environment variables as those must be UNSET in container#654

Merged
ndeloof merged 1 commit intocompose-spec:mainfrom
ndeloof:empty-env
Jul 8, 2024
Merged

keep empty environment variables as those must be UNSET in container#654
ndeloof merged 1 commit intocompose-spec:mainfrom
ndeloof:empty-env

Conversation

@ndeloof
Copy link
Copy Markdown
Collaborator

@ndeloof ndeloof commented Jul 4, 2024

environment FOO with no value nor equal sign means "propagate value from user's environment, or unset variable"
So, as we resolve environment, empty value with no matching entry in user's environment MUST not result into removing entry from service definition.
Build args do not follow this rule. --build-arg FOO will propagate user's environment value, but if not set build arg will keep using value set by Dockerfile

fixes docker/compose#11962
supersede #634
see docker/compose#11965

Copy link
Copy Markdown
Collaborator

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ndeloof ndeloof marked this pull request as ready for review July 5, 2024 15:34
Copy link
Copy Markdown
Collaborator

@jhrotko jhrotko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof enabled auto-merge (rebase) July 8, 2024 10:12
@ndeloof ndeloof merged commit 6adefd5 into compose-spec:main Jul 8, 2024
@ndeloof ndeloof deleted the empty-env branch July 8, 2024 10:34
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.

Official expected behavior about default ENV variables set in images and listed in docker-compose manifest

3 participants