Skip to content

[BUG] --no-path-resolution ineffective since 2.24.1 for extended services #11377

@luciangabor

Description

@luciangabor

Description

docker compose config --no-path-resolution no longer works since 2.24.1 for services that extend another one from a different file

Steps To Reproduce

  1. Create compose.yaml
services:
  service:
    build: .
    volumes:
      - ./:/mnt

  extended:
    extends:
      file: another.yaml
      service: service
  1. Create another.yaml
services:
  service:
    build: .
    volumes:
      - ./:/mnt

  1. Run the config command with docker compose 2.24.1
$ docker compose config --no-path-resolution
name: bug
services:
  extended:
    build:
      context: /path/to/bug
      dockerfile: Dockerfile
    networks:
      default: null
    volumes:
      - type: bind
        source: /path/to/bug
        target: /mnt
        bind:
          create_host_path: true
  service:
    build:
      context: .
      dockerfile: Dockerfile
    networks:
      default: null
    volumes:
      - type: bind
        source: ./
        target: /mnt
        bind:
          create_host_path: true
networks:
  default:
    name: bug_default
  1. Run the config command with docker compose 2.23.3
$ docker compose config --no-path-resolution
name: bug
services:
  extended:
    build:
      context: .
      dockerfile: Dockerfile
    networks:
      default: null
    volumes:
      - type: bind
        source: .
        target: /mnt
        bind:
          create_host_path: true
  service:
    build:
      context: .
      dockerfile: Dockerfile
    networks:
      default: null
    volumes:
      - type: bind
        source: ./
        target: /mnt
        bind:
          create_host_path: true
networks:
  default:
    name: bug_default

  1. Note the differences
  • the context path for the build and the source path for the volume of the extended service are resolved

Compose Version

Docker Compose version v2.24.1

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