Docker Compose Profiles - Service Skipped / "no service selected" in CI
A Compose service assigned to a profiles: entry only starts when that profile is active. In CI the profile is often not enabled, so the service is silently skipped and downstream steps fail to reach it.
What this error means
A docker compose up starts only some services; a profiled one is missing, and a later step fails connecting to it. Or a command errors that no service matched the requested profile. No build error - the service was simply filtered out.
services:
e2e:
profiles: ["test"]
# 'docker compose up' (no profile) starts nothing in the test profile:
# the 'e2e' service is skipped; connecting to it later failsCommon causes
The profile was not activated
A service under profiles: ["test"] only runs when --profile test or COMPOSE_PROFILES=test is set. A plain compose up excludes it by design.
Profile name mismatch
Activating --profile e2e while the service declares profiles: ["test"] activates nothing, so the service stays skipped.
A dependency is profiled but the dependent is not
A non-profiled service that depends_on a profiled one can fail because the dependency is filtered out unless its profile is active.
How to fix it
Activate the profile explicitly
Enable the profile via the flag or the environment variable.
docker compose --profile test up -d
# or via env:
COMPOSE_PROFILES=test docker compose up -dAlign profile names and dependencies
- Make the
--profile/COMPOSE_PROFILESvalue match the service’s declared profile exactly. - Ensure any profiled dependency is in the same activated profile as its dependent.
- Run
docker compose config --profile testto see which services are actually selected.
How to prevent it
- Set
COMPOSE_PROFILES(or--profile) in CI for any profiled services you need. - Keep profile names consistent between services and activation.
- Validate the selected service set with
docker compose configbeforeup.