compose icon indicating copy to clipboard operation
compose copied to clipboard

Environment files not read by default in Windows host

Open alanondra opened this issue 3 years ago • 2 comments

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:

  1. Create any project with a docker-compose.yml and .env file at the project root
  2. Create a directory to configure at least one container with its own Dockerfile
  3. Set up the container's build directives to use it
  4. 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

alanondra avatar Jan 04 '22 06:01 alanondra

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.

stale[bot] avatar Jul 10 '22 12:07 stale[bot]

This issue has been automatically closed because it had not recent activity during the stale period.

stale[bot] avatar Jul 31 '22 23:07 stale[bot]

This issue has been automatically closed because it had not recent activity during the stale period.

stale[bot] avatar Aug 13 '22 11:08 stale[bot]