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.

Part of the Docker Toolkit
1 error
  • References named volume "dbdata", which isn't declared in the top-level "volumes:" section.
    services.db.volumes[0]

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.

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."

Does this check for the YAML yes/no boolean trap?

No — that check was removed. Verified against a real, current Docker Compose install: the classic "Norway problem" (unquoted no/yes/on/off silently becoming a boolean) no longer reproduces in current Compose, so flagging it would have been a false positive. See Common Docker Compose Errors for the full writeup, including the real (and much less obvious) error a malformed port mapping actually produces.

Related tools