Skip to content

Filter services in config --no-interpolate to respect [SERVICE...] argument#13637

Open
odlev wants to merge 1 commit intodocker:mainfrom
odlev:13614-fix-no-interpolate-service-filter
Open

Filter services in config --no-interpolate to respect [SERVICE...] argument#13637
odlev wants to merge 1 commit intodocker:mainfrom
odlev:13614-fix-no-interpolate-service-filter

Conversation

@odlev
Copy link

@odlev odlev commented Mar 15, 2026

What I did

When using docker compose config --no-interpolate with specific service names
(e.g., docker compose config --no-interpolate example1), the [SERVICE...]
argument was being ignored and all services were output.

The root cause is that runConfigNoInterpolate() calls ToModel() which
returns the full model without filtering by service names. Added service
filtering after model loading to match the behavior of the interpolated
code path.

Related issue

Fixes #13614

How I tested

  • Added an e2e test with a multi-service compose file that verifies only
    the requested service is output when using --no-interpolate with a
    service name filter
  • Verified the build compiles and existing unit tests pass

…gument

    When using docker compose config --no-interpolate with specific service
    names, the SERVICE argument was being ignored and all services were
    returned. This adds service filtering after the model is loaded in the
    no-interpolate code path.

    Fixes docker#13614

    Signed-off-by: odlevq@gmail.com
@odlev odlev requested a review from a team as a code owner March 15, 2026 17:37
@odlev odlev requested review from glours and ndeloof March 15, 2026 17:37
@ndeloof
Copy link
Contributor

ndeloof commented Mar 15, 2026

that's incorrect. A compose command with a SERVICE set will enable target service and dependencies, which is challenging to implement as the dependency logic relies on go types in compose-go

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] --no-interpolate flag on docker compose config has unexpected side effects

2 participants