compose-spec / compose-go

Reference library for parsing and loading Compose YAML files
https://compose-spec.io
Apache License 2.0
350 stars 109 forks source link

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

Closed ndeloof closed 2 months ago

ndeloof commented 2 months ago

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 https://github.com/docker/compose/issues/11962 supersede https://github.com/compose-spec/compose-go/pull/634 see https://github.com/docker/compose/pull/11965