Description
v2.9.0 does not allow environment variables to be overridden if they are already present in .env.
Steps to reproduce the issue:
- With the following files:
docker-compose.yml:
version: '3.9'
services:
app:
image: app:${APP_CONTAINER_TAG}
proxy:
image: proxy:${PROXY_CONTAINER_TAG}
And .env
APP_CONTAINER_TAG=bar
PROXY_CONTAINER_TAG=bar
- When I run
APP_CONTAINER_TAG=foo PROXY_CONTAINER_TAG=foo ./docker-compose-2.9.0 convert, I receive the following
name: test
services:
app:
image: app:bar
networks:
default: null
proxy:
image: proxy:bar
networks:
default: null
networks:
default:
name: test_default
In versions prior, like 2.7.0, I would get the expected behavior:
name: test
services:
app:
image: app:foo
networks:
default: null
proxy:
image: proxy:foo
networks:
default: null
networks:
default:
name: test_default
Output of docker compose version:
Docker Compose version v2.9.0
Additional environment details:
I noticed this on my GitHub Actions environments. The runner recently updated Docker Compose to v2.9.0.
Description
v2.9.0 does not allow environment variables to be overridden if they are already present in
.env.Steps to reproduce the issue:
docker-compose.yml:And
.envAPP_CONTAINER_TAG=foo PROXY_CONTAINER_TAG=foo ./docker-compose-2.9.0 convert, I receive the followingIn versions prior, like
2.7.0, I would get the expected behavior:Output of
docker compose version:Additional environment details:
I noticed this on my GitHub Actions environments. The runner recently updated Docker Compose to v2.9.0.