DevTools Hub

Search tools

Search for a developer tool

Docker

Docker Compose Validator

Check a docker-compose.yml for undefined services, bad ports, and undeclared volumes/networks.

1 error 1 warning
  • References named volume "dbdata", which isn't declared in the top-level "volumes:" section.
    services.db.volumes[0]
  • Value for "DEBUG" was parsed as a boolean (true) — an unquoted yes/no/true/false/on/off is interpreted as a boolean by Compose's YAML parser. Quote it (e.g. "DEBUG: \"true\"") if you meant the literal text.
    services.api.environment.DEBUG

What this checks

Paste a docker-compose.yml file and it's checked for the mistakes that typically only surface once you run docker compose up: services missing an image or build, invalid or out-of-range port mappings, a depends_on entry pointing at a service name that doesn't exist (a common typo), and named volumes or networks referenced in a service but never declared in the top-level volumes: or networks: section — which Compose itself rejects as an undefined reference.

It also catches a YAML-specific trap that's easy to miss: Compose's YAML parser follows YAML 1.1, where an unquoted yes, no, on, or off is read as a boolean, not the literal text. An environment value like DEBUG: yes silently becomes the boolean true rather than the string "yes" — this tool parses with the same 1.1 rules Compose uses, specifically so it catches this the same way Compose would.

What it doesn't do

This is a structural and syntax check, not a full reimplementation of the Compose Specification schema. It doesn't validate build context contents, resolve .env file interpolation, or check whether an image actually exists in a registry. Windows-style absolute host paths in volume mounts (e.g. C:\data:/data) are skipped rather than mis-parsed, since the drive-letter colon is ambiguous with Compose's own : separator.

FAQ

Why does it say the "version" key is obsolete?

The version: top-level key came from the original, now-retired Compose file format spec. The current Compose Specification (used by Docker Compose v2 and later) ignores it entirely — it's safe to delete rather than update.

Why 1-65535 for ports?

That's the full valid TCP/UDP port range. A port mapping outside it (a typo like an extra trailing digit) will fail when Compose tries to bind it, usually with a less obvious error than "invalid port."

Related tools