Compose "no such service" in CI
A docker compose up/run/build <service> command referenced a service name that is not defined in the active compose files. Compose resolves the merged config and finds no service by that name, so it stops.
What this error means
A compose command fails with "no such service: <name>". The name is misspelled, defined in a file that was not loaded, or hidden behind a profile.
no such service: webCommon causes
A misspelled service name
The command argument does not match any key under services: in the merged compose configuration.
The service lives in a file not loaded
The service is defined in an override or alternate compose file that was not passed with -f, so it is absent from the resolved set.
How to fix it
List services and use an exact name
- Run
docker compose config --servicesto see resolved service names. - Use the exact name (it is case-sensitive).
- Add the
-ffile that defines the service if it was missing.
docker compose config --services
docker compose -f docker-compose.yml -f docker-compose.ci.yml up webEnable the profile that contains the service
If the service is gated behind a profile, enable it so the service is part of the resolved set.
docker compose --profile ci up testsHow to prevent it
- Verify service names with
docker compose config --services. - Pass every compose file the command needs with
-f. - Enable required profiles before targeting their services.