COMPOSE_FILE env var is ignored

Not so long ago, I used to declare my compose files I want to merge in an .env.staging file.
In this file I have COMPOSE_FILE=docker-compose.yaml:docker-compose.staging.yaml
Then I up my container with this : docker compose --env-file .env.staging up -d

It used to work like a charm but since the last Docker Desktop update it seems that docker is ignoring the COMPOSE_FILE env var var declared in the .env.staging file…

Is it a regression or this is on purpose and there’s another way?

It works if I specify each file with the -f arg but that’s annoying :slight_smile:

Any idea? Thanks!

Here is the documentation:

It seems that way.

Since I misunderstood the question first, I leave a note for others confirming that variable works with the default .env file but not when the env file name is overridden. Removing the leading dot does not help either.

So I downloaded the latest compose from GitHub:

I had to make it executable and also browse it in Finder, click on it and choose “Open with” to open it in the terminal so macOS could let me allow running the script downloaded from the internet and then I used it from the terminal as ./docker-compose. Or you could replace the original compose with the new release

mv docker-compose ~/.docker/cli-plugins/docker-compose

I never actually did that so I don’t know what happens when new Docker Desktop is upgraded and comes with an even newer version, since the original file is just a symbolic link.