Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-compose --env-file unknown flag

Today I updated Docker (Docker for Mac) to 4.22.0

When I try to execute

docker-compose up --env-file .env.local

I get

unknown flag: --env-file

I could make it work if I create a new file .env, but is there a way to pass the env file as an argument of docker-compose?

like image 296
agusgambina Avatar asked Sep 04 '26 15:09

agusgambina


1 Answers

Following the official documentation you should specify it with the command:

 docker compose --env-file .env.local up

The file path is relative to the current working directory where the Docker Compose command is executed.

like image 122
Alez Avatar answered Sep 07 '26 08:09

Alez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!