Reputation: 324
Case: I start a service in docker-compose
.
All the variables in the .env
file are ignored and not dynamically replaced, such as below:
PS C:\workarea\jonathan\myProject> docker-compose up -d myService
time="2021-07-23T15:20:50-04:00" level=warning msg="The XXXXX_URL variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The XXXXX_USER variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The XXXXX_PASSWORD variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The YYYY_URL variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The ZZZ_URL variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The XXXXX_URL variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The XXXXX_USER variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The XXXXX_PASSWORD variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The YYYY_URL variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The ZZZ_URL variable is not set. Defaulting to a blank string."
time="2021-07-23T15:20:50-04:00" level=warning msg="The DDDDD_ROOT_PASSWORD variable is not set. Defaulting to a blank string."
...
Environment:
Upvotes: 3
Views: 1264
Reputation: 324
The solution consists in disabling Use Docker Compose V2
in Settings > Experimental Features, then "Apply and Restart":
Warning: although this option is unchecked, Docker happens to re-enable it without any user's action. This occurred to me several times, on two different laptops.
Upvotes: 1