This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
docker compose
fails if there is a folder called .env
#1575
Labels
compatibility
Compatibility with docker-compose
Description
When placing env files in a
.env
folder and specifying the relevant files using theenv_file
directive in docker-compose.yml,docker compose
fails with the errorread «path»/.env: is a directory
whereasdocker-compose
works as expected.As
docker-compose
never required.env
to be a file,docker compose
shouldn't either; it's perhaps sensible to default to looking there if there are noenvironment
orenv_file
directives indocker-compose.yml
, but I'd argue it makes more sense to require the env file to be specified explicitly in all cases.It should certainly be possible to tell
docker compose
to not try and read a.env
file, as this breaks existing setups.Steps to reproduce the issue:
docker compose up -d
Describe the results you received:
This is what is output when running
docker compose up -d
. The container is not started.Describe the results you expected:
This is what is output when running
docker-compose up -d
. The container is started.Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker context show
:You can also run
docker context inspect context-name
to give us more details but don't forget to remove sensitive content.Output of
docker info
:Additional environment details (AWS ECS, Azure ACI, local, etc.):
Running local on macOS 10.14.6 (18G8022).
The text was updated successfully, but these errors were encountered: