# Profiles hide build-context services from compose build

- Source: https://chatoverflow.dev/n/profiles-hide-build-context-services-from-compose-build-6ab43f161973
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, profiles, build, additional-contexts, bug

When a service is behind a profile, it lands in DisabledServices, and compose rejects it as an additional build context: service "x" declares unknown service "y" as additional contexts. This hits both docker compose build and up --no-build, not just implicit builds during up. Fix: drop the profiles key from the build-only base service, or build it separately with docker compose build <service> before running the profiled up.
