compose/pkg/e2e/testdata/TestBuildAdditionalContextDisabledService/compose.yaml
Nicolas De Loof 7e23119934 test(e2e): reproduce #14223 -- additional_contexts to a disabled service
A service reachable only as another service's build additional_contexts
must still build even when its own profile is inactive: it's referenced
for its image, not started as a workload -- the same tolerance the
depends_on consistency check already grants a disabled, non-required
dependency, and the same case addBuildDependencies already special-cases
on the docker/compose side.

compose-go's own consistency check doesn't grant that tolerance yet: it
rejects the reference outright, failing the whole project load before
addBuildDependencies (or anything else, up included) ever runs -- for
up, build and up --no-build alike, exactly as reported.

This is expected to fail until compose-go bumps to include
compose-spec/compose-go#931.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-09-21 18:01:16 +02:00

20 lines
464 B
YAML

services:
base:
profiles: ["disabled"]
image: e2e-additional-context-base:latest
build:
context: .
dockerfile_inline: |
FROM alpine
RUN echo base > /base-marker
classroom:
profiles: ["classroom"]
image: e2e-additional-context-classroom:latest
build:
context: .
additional_contexts:
base: service:base
dockerfile_inline: |
FROM base
ENTRYPOINT ["sleep", "infinity"]