51

Docker Compose reads your “.env” without opt-out

 3 years ago
source link: https://www.tuicool.com/articles/zMZrQzM
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Similar/repeat request to #4642 . New/different reason now though. Related to #6511 .

Other systems use the exact same file .env for parsing and processing environment variables. With the release of 1.24.0, the feature where Compose will no longer accept whitespace in variable names sourced from environment files. This matches the Docker CLI behavior. breaks compatibility with other .env utilities. Although my setup does not use the variables in .env for docker-compose, docker-compose now fails because the .env file does not meet docker-compose's format.

I either have to make the .env file fit docker-compose's format or remove the file.

I propose that you can specify an option to ignore the .env file or specify a different .env file (such as .docker.env ) in the docker-compose.yml file so that we can work around projects that are already using the .env file for something else.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK