compose
compose copied to clipboard
Environment files not read by default in Windows host
Description
A project that successfully uses .env
by default in a Linux host will not use it by default in a Windows host, even after completing WSL setup.
Steps to reproduce the issue:
- Create any project with a
docker-compose.yml
and.env
file at the project root - Create a directory to configure at least one container with its own
Dockerfile
- Set up the container's
build
directives to use it - Perform any operation using the environment variables
Describe the results you received:
- On the Linux host, the
.env
file is read in by default. - On a Windows host, the
.env
file is completely ignored, and the values from the.env
file are not set.
Describe the results you expected:
I expected that in both host machines the .env
file would be read in by default.
Additional information you deem important (e.g. issue happens only occasionally):
The only way to get .env
files to be read in on the Windows host is to explicitly define the env_file
directive in docker-compose.yml
. It cannot be specified or overridden in the command line at all.
Output of docker compose version
:
Windows and Linux: 1.29.2
Additional environment details:
Windows
- Version: 10 Pro 21H1
- Linux Subsystem: Debian
Linux
- Distribution: LMDE 4
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.
This issue has been automatically closed because it had not recent activity during the stale period.