Skip to content
Latchkey

Buildkite docker-compose plugin "service not found" in CI

The docker-compose plugin runs the service named in its run key. If that name is missing from the referenced compose file, Docker Compose reports "no such service" and the step fails.

What this error means

A step using the docker-compose plugin fails with "no such service" naming the service the plugin tried to run.

buildkite
$ docker compose -f docker-compose.yml run app
no such service: app
The command exited with status 1

Common causes

The run service name does not match the compose file

The plugin run: app refers to a service that is spelled differently or absent in docker-compose.yml.

The wrong compose file is referenced

The plugin points at a compose file that does not define the service, for example an override file used alone.

How to fix it

Match the run service to a defined service

  1. Open the compose file and list the service keys under services:.
  2. Set the plugin run value to one of those exact names.
  3. Reference every compose file the service needs.
pipeline.yml
steps:
  - command: "npm test"
    plugins:
      - docker-compose#v4.16.0:
          run: app
          config: docker-compose.yml

Include all required compose files

If the service is split across files, pass them all so the service is defined when the plugin runs it.

pipeline.yml
plugins:
  - docker-compose#v4.16.0:
      run: app
      config:
        - docker-compose.yml
        - docker-compose.ci.yml

How to prevent it

  • Keep the plugin run name in sync with the compose service keys.
  • Reference every compose file needed to define the service.
  • Validate the compose config with docker compose config in review.

Frequently asked questions

What causes "docker-compose "service not found""?
The plugin run: app refers to a service that is spelled differently or absent in docker-compose.yml.
How do I fix docker-compose "service not found"?
Match the run service to a defined service

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card