← Back

Docker Compose Validator

LOCAL

Check docker-compose.yml files for structure, services, ports, volumes and syntax.

Compose YAML

Result

What is Docker Compose Validator?

The Docker Compose Validator parses one YAML document and checks selected Compose fields. It looks for services, an image or build setting per service, arrays for ports and service volumes, and an object or array for environment. It is a preliminary structure check, not a complete implementation of the Compose Specification.

How to use Docker Compose Validator

Paste services: {web: {image: "nginx:alpine", ports: ["8080:80"]}} and choose Validate. This compact YAML notation describes a web service and should produce “No problems found” in this tool. The quotation marks keep the port mapping as text. No container is started and the image is not downloaded.

When is Docker Compose Validator useful?

Use it to catch YAML punctuation or indentation errors and some incorrect field types before opening your Docker project. The top-level version field is not required by this check. Passing does not verify that a host port is free, that a bind-mount path exists or that the application listens on the configured container port.

Example

Now try services: {web: {image: "nginx:alpine", ports: "8080:80"}}. The tool should report that the web service’s ports must be an array. Change the value back to ["8080:80"] to remove that warning. A missing closing bracket instead produces a YAML syntax error; those two errors have different causes.

Practical notes

Only one document is accepted. Includes, interpolation, extended configurations, nested field schemas and service-to-service references are not resolved. Some valid advanced configurations can trigger a simplified warning and some invalid ones can pass. Validate the actual resolved project with docker compose config --quiet in its project environment. This page processes pasted data locally and does not contact Docker. Reference: Docker Compose configuration reference.