Closed david-jointech closed 3 months ago
After updating to compose 2.27.1 loading the COMPOSE_FILE from a .env-file doesn't work anymore as expected. The variable is set, but the additional docker-compose files aren't loaded.
docker-compose.yaml
services: test: image: bash volumes: - ./test:/test
docker-compose.network.yaml
services: test: networks: - internal networks: internal:
.env
COMPOSE_FILE=docker-compose.yaml:docker-compose.network.yaml
Then I run the following command:
docker compose --env-file .env config
Which gives me this output:
name: compose-test services: test: image: bash networks: default: null volumes: - type: bind source: <pwd>/compose-test/test target: /test bind: create_host_path: true networks: default: name: compose-test_default
As can be seen, the network-compose-file is completly ignored in this scenario.
When I run docker compose --file docker-compose.yaml --file docker-compose.network.yaml config instead, I get the expected output:
docker compose --file docker-compose.yaml --file docker-compose.network.yaml config
name: compose-test services: test: image: bash networks: internal: null volumes: - type: bind source: <pwd>/compose-test/test target: /test bind: create_host_path: true networks: internal: name: compose-test_internal
This also applies to other docker compose commands (e.g. up).
docker compose
up
Docker Compose version 2.27.1
No response
Already fixed by https://github.com/docker/compose/pull/11889
Description
After updating to compose 2.27.1 loading the COMPOSE_FILE from a .env-file doesn't work anymore as expected. The variable is set, but the additional docker-compose files aren't loaded.
Steps To Reproduce
docker-compose.yaml
docker-compose.network.yaml
.env
Then I run the following command:
docker compose --env-file .env config
Which gives me this output:
As can be seen, the network-compose-file is completly ignored in this scenario.
When I run
docker compose --file docker-compose.yaml --file docker-compose.network.yaml config
instead, I get the expected output:This also applies to other
docker compose
commands (e.g.up
).Compose Version
Docker Environment
No response
Anything else?
No response