-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Description
With f38f3f7 the environment variable PWD will always be overwritten with the parent working directory using the Go function https://pkg.go.dev/os#Getwd.
This might be OK in 99% of all use cases, but this change breaks a special use case:
I need to set the PWD variable differently to match another directory structure within a VM that actually runs the Docker daemon. e.g. a Windows host system and a Debian guest system. The CLI tools docker with the docker compose plugin are installed on the Windows host and access the Docker daemon on the Debian guest. Directories are synced from the Windows host to the Debian host and therefore have another parent working directory in the context of the VM
Suggestion: Please check if a PWD environment variable is present and only if it is not set it to the result of os.Getwd(). That is a defensive programming technique and will satisfy both use cases.
This defect has been introduced with https://github.com/docker/compose/releases/tag/v2.35.0 with v2.34.0 it is still possible to set a specific PWD variable.
Steps To Reproduce
No response
Compose Version
Docker Environment
Anything else?
No response