Skip to content

[BUG] including files with a custom project directory is ... just broken in 2.25.0 #11626

@luciangabor

Description

@luciangabor

Description

Extras from https://docs.docker.com/compose/compose-file/14-include/#project_directory

project_directory defines a base path to resolve relative paths set in the Compose file. It defaults to the directory of the included Compose file.

This was broken even before, due to being applied ... "blindly" (see #11573 - I think it shouldn't apply to elements that define yaml "structure" - something that "brings" behavior).

Yet, with 2.25.0 it is simply ignored in the cases it actually worked before.
I've tried with env files, with bind mounts and build contexts.

Steps To Reproduce

Including this:

services:
  service:
    build:
      dockerfile_inline: |
        FROM busybox
        COPY /something /
    volumes:
      - type: bind
        source: something
        target: /mnt/bind
    env_file:
      - env

with a project directory set to a directory that contains an env file and a file or directory named something used to work

Compose Version

Docker Compose version v2.25.0

Docker Environment

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions