Skip to content
cosmodev ~/tools/compose-validator

Docker Compose-validering

Validators & Testers

Valider en compose-fil i browseren: image eller build pr. service, portsyntaks og intervaller, environment-format, volumes og depends_on-grafen med cyklusdetektion. Kører lokalt med et delbart link.

Prøv:

(Dokumentation på engelsk)

What it does

Structurally validates a Docker Compose file: a services mapping where every service defines image or build, port entries with correct syntax and range ("8080:80", host forms like "127.0.0.1:80:80" and IPv6 like "::1:8080:80", protocols tcp/udp), environment in either mapping or KEY=value list form, volumes as a list, and the depends_on graph — unknown targets and cycles, with the chain named. YAML errors surface with the parser’s message. Everything runs locally in your browser.

How to use it

  1. Paste a compose file into Compose file (left), or tap a chip — Valid compose, Bad ports, depends_on cycle. Sample loads a three-service file; Clear empties the box.
  2. The verdict appears on the right: green when the structure holds; otherwise every issue with its path and message.
  3. Copy share link encodes the file in the URL.

Examples

The Bad ports chip reports both port problems at indexed paths:

$.services.web.ports[0] — port 70000 out of range 0-65535 · $.services.web.ports[1] — unknown protocol "sctp" (use tcp or udp)

A service with neither image nor build:

$.services.orphan — service needs image or build

Host-form ports pass — a non-numeric part anywhere means a host is present:

"localhost:8080:80" and "::1:8080:80" are both valid.

What is checked (and what deliberately is not)

Checked Not checked
services mapping, non-empty, map bodies image tag validity, registry reachability
image or build per service build context and dockerfile paths
port syntax, ranges, protocols network/volume top-level definitions
environment map/list form, scalar values profiles, extends, resource limits
depends_on: known, acyclic interpolated variables (${…})

The tool catches the structural class — the mistakes that fail before your containers start. Runtime concerns (does the image exist, is the tag current) belong to the daemon.

Kildekode14 sprog

100% client-side · dine data forlader aldrig din browser. Fandt du dette nyttigt? Del det med en i dit team.