-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular Reference Error in Docker Compose v2.24.5 with extends Feature #11516
Comments
This has been fixed already in v2.24.6, could you please give it a try to confirm ? |
When I look at the 'Fixes' in https://github.com/docker/compose/releases/tag/v2.24.6, I don't see this mentioned here. Is this fix the reason I'm seeing this?
|
@gisostallenberg this doesn't appear on docker/compose release note as this is related to the compose file parser library |
Looks like the latest version of Docker Desktop doesn't yet have access to this docker-compose bug fix? https://docs.docker.com/desktop/release-notes/#4272 |
2.24.6 is still not in the Linux apt repos. |
I have changed the 3 files a bit: version: '3.8'
services:
app_base:
image: alpine
command: ["echo", "Hello from Base Service"] intermediate.yaml version: '3.8'
services:
db_service:
image: postgres
environment:
POSTGRES_DB: exampledb
POSTGRES_USER: exampleuser
POSTGRES_PASSWORD: examplepass
app_service:
extends:
file: base.yaml
service: app_base
environment:
- APP_MODE=intermediate
depends_on:
- db_service final.yaml version: '3.8'
services:
db_service:
extends:
file: intermediate.yaml
service: db_service
environment:
- DB_USER=user
app_service:
extends:
file: intermediate.yaml
service: app_service
ports:
- "8080:80" apt install docker-compose-plugin=2.24.2-1~ubuntu.22.04~jammy
docker compose -f final.yaml up -d
docker compose -f final.yaml up -d
[+] Running 2/2
✔ Container dockerbug-db_service-1 Started 0.7s
✔ Container dockerbug-app_service-1 Started 0.6s BUT:
2.24.6-1 now comes with this bug which still impacts my development significantly.:( |
This constraint was well documented, and I'm surprised so many users just discover this as some check was added to the parser. wonder why I spend so much time writing docs 😅 |
Closing this issue as the original reported bug is confirmed to be fixed |
Description
After upgrading to Docker Compose version 2.24.5, I encountered a "Circular reference" error when using the extends feature across multiple docker-compose.yml files. This issue did not occur in version 2.24.2. The setup involves three Docker Compose files where one service extends from another, which in turn extends from a base service defined in another file. The intended behavior is to inherit configurations across these files without issues.
Steps To Reproduce
Create three Docker Compose files (base.yaml, intermediate.yaml, final.yaml) with the following content:
base.yaml:
intermediate.yaml:
final.yaml:
Run docker compose -f final.yaml up with Docker Compose version 2.24.5-1.
Expected Result:
The service app_service starts up successfully, inheriting configurations from both base.yaml and intermediate.yaml.
Actual Result:
Received a circular reference error:
Compose Version
Docker Environment
Anything else?
The problem persists only with Docker Compose version 2.24.5-1. This issue significantly impacts development workflows that rely on the extends feature for modular and reusable service configurations.
The text was updated successfully, but these errors were encountered: