-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[BUG] including files with a custom project directory breaks when compose is run from a nested folder #11573
Copy link
Copy link
Closed
Labels
Description
Description
Please see the steps below.
Steps To Reproduce
- With these
compose.yaml,dir/included.yamlanddir/extended.yamlfiles:
---
# compose.yaml
include:
- project_directory: .
path: dir/included.yaml
---
# dir/included.yaml
services:
included:
extends:
file: dir/extended.yaml
service: extended
---
# dir/extended.yaml
services:
extended:
image: image
- Observe the output of the
configcommand when ran from.ordir:
$ docker compose config
name: proj-dir
services:
included:
image: image
networks:
default: null
networks:
default:
name: proj-dir_default
$ env -C dir docker compose config
cannot read dir/extended.yaml
Compose Version
Docker Compose version v2.24.6
Docker Environment
No response
Anything else?
Furthermore, in case of "double extends", I mean if dir/extended.yaml would look ... "as expected" ... like this:
services:
extended:
extends:
file: dir/base.yaml
service: base
with dir/base.yaml like this:
services:
base:
image: image
it would lead to:
$ docker compose config
cannot read dir/dir/base.yaml
Which could be fixed by mixing both ways of referring to files in dir, but ... I guess this has to wait and see if the very first extend was indeed supposed to be relative to the customized project directory anyway ...
Reactions are currently unavailable