-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-compose V2 does not support default variable values in .env files anymore #9303
Comments
What happens when you execute a command? |
I attached an example. Just run "docker-compose up" and it prints the following with docker-compose V1:
Now when running it with docker-compose V2:
NOTE: the different between V1 and V2 is the printed warning and the missing my-default-value value of EXAMPLE_BAD env variable. |
Any news on this? |
Should be fixed by compose-spec/compose-go#276 and included in the next release of Docker Compose. |
We use docker-compose with .env files.
In the .env files, we use this syntax:
VARIABLE=${VARIABLE:-default}
which evaluates to default if VARIABLE is unset or empty in the environment in docker-compose V1.
(as described here https://docs.docker.com/compose/environment-variables/)
With V2, the VARIABLE is not set to default with this syntax.
We tested this on Windows and Linux, with Docker Compose version v2.3.3.
The default value syntax works inside of the docker-compose.yml file, but it does not work in the .env file anymore.
This used to work fine in docker-compose V1.
The text was updated successfully, but these errors were encountered: