TorizonCore Builder and compose files with "extends: file" fails

I am getting errors trying to use TorizonCore builder with compose files that have inheritance/extensions via the

extends:
    file: myfile.yml
    service: my-service

TCB throws the following error:

Creating Docker Container bundle...
Error: Could not load the Docker compose file 'docker-compose.deploy.yml'.

If I remove the file: specification and paste the contents of myfile.yml into the top level compose things seem to progress further and it actually attempts to start DiND and do the build.

(if it matters, myfile.yml is in a subfolder one level below tcbuild.yml and the top-level compose file)

Is this a known limitation of TCB, or is it something that is slated for future support?

Thanks!

Greetings @bw908,

At the moment I believe TorizonCoreBuilder and our system in general does not support this multi-compose file usage. In the end our system only has knowledge of and manages a single docker-compose file at a time.

Furthermore it seems like this extends keyword is not supported in the later versions of the Docker-Compose standard: Share Compose configurations between files and projects | Docker Documentation

That said could you discuss what exactly your use-case here is so I can try and understand why you’re using the extends keyword. Maybe there is something further we can do or discuss here to assist you.

Best Regards,
Jeremias

To provide some context we have a common “shared” file that defines common properties and services. This is then used in multiple “top level” docker-compose files for different scenarios, e.g. running unit tests, local development, or actual hardware deploy configurations.

It sounds like if the extends keyword has been deprecated in future versions of the specification then it is on us to consider alternatives to manage our configuration (and in retrospect this is probably going to fit better for our use case).

Thanks for the explanation - though I would be interested to hear if you have any suggestions on sharing “common” compose blocks between multiple higher-level compose files that is supported by torizoncore-builder.

though I would be interested to hear if you have any suggestions on sharing “common” compose blocks between multiple higher-level compose files that is supported by torizoncore-builder.

Honestly there really isn’t any mechanism at the moment. TorizonCore Builder excepts a single docker-compose file. This file is expected to have defined in it everything related to your container configuration.

Also now that it seems the extends keyword isn’t being supported universally by the Docker Compose specification. I’m not sure if there is a “supported” mechanism to share/inherit contents from one compose file to another. A custom mechanism could be created, though that poses other difficulties since the Docker Compose spec isn’t under our control.

Best Regards,
Jeremias