Skip to content
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

[BUG] --no-path-resolution ineffective when using include #11508

Closed
luciangabor opened this issue Feb 16, 2024 · 1 comment · Fixed by compose-spec/compose-go#579
Closed

[BUG] --no-path-resolution ineffective when using include #11508

luciangabor opened this issue Feb 16, 2024 · 1 comment · Fixed by compose-spec/compose-go#579

Comments

@luciangabor
Copy link

Description

When an included file contains relative paths (at least) for build contexts or volume definitions, docker compose config --no-path-resolution outputs the full paths. It doesn't look like a regression, maybe a missing feature, but nevertheless, please see below.

Steps To Reproduce

  1. Create the compose.yaml
include:
  - path: included.yaml

services:
  extended:
    extends:
      file: included.yaml
      service: included
  1. Create an included.yaml
services:
  included:
    build: .
    volumes:
      - ./:/mnt
  1. Observe the output of the config command
$ docker compose config --no-path-resolution
name: inc
services:
  extended:
    build:
      context: .
      dockerfile: Dockerfile
    networks:
      default: null
    volumes:
      - type: bind
        source: .
        target: /mnt
        bind:
          create_host_path: true
  included:
    build:
      context: /path/to/inc
      dockerfile: Dockerfile
    networks:
      default: null
    volumes:
      - type: bind
        source: /path/to/inc
        target: /mnt
        bind:
          create_host_path: true
networks:
  default:
    name: inc_default

The example is set up so that what's actually the same service gets presented in different ways.

Compose Version

Docker Compose version v2.24.6

Docker Environment

No response

Anything else?

No response

@milas
Copy link
Contributor

milas commented Mar 6, 2024

This fix has been included in Compose 2.24.7+. If you continue to have problems after upgrading, comment here and we can re-open the issue or create a new one as appropriate. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants