Docker Error Guide: 'Version is unsupported' — The Obsolete Compose version Key
Fix 'Version in docker-compose.yml is unsupported': the top-level version key is obsolete in Compose v2. Remove it, or upgrade Compose to match your file schema.
- #docker
- #troubleshooting
- #errors
- #compose
Stuck on this Docker with AI error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
Overview
Compose rejects your file because of the version it declares at the top:
Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version.
The top-level version: key selected a Compose file schema in the v1 era. In Compose v2 that key is obsolete — the schema is unified and versionless — and an out-of-range or malformed value triggers this error (or, on newer releases, a deprecation warning). The reliable fix on modern Compose is to delete the version: line entirely.
Symptoms
docker compose configordocker compose upfails naming an unsupported version string.- Newer Compose prints
the attribute 'version' is obsolete, it will be ignoredas a warning rather than a hard error. - A file with
version: "2"orversion: "3"works on one host and fails on another with different Compose releases. - The value is quoted oddly (
version: 3.8as a float vsversion: "3.8"as a string) and parsing behaves inconsistently. - Copy-pasted legacy tutorials specify
version:keys that your Compose no longer accepts.
Common Root Causes
version:key present on Compose v2. The key is obsolete; a stale or invalid value surfaces as unsupported.- A version string your Compose does not recognize — e.g. an old
2.0/2.1micro-version or a typo like3..8. - Version/feature mismatch. The file declares a schema version that predates features it uses, or vice versa.
- Mismatched Compose binary. A very old
docker-composev1 is being invoked against a file written for a newer schema. - YAML type confusion.
version: 3.8parses as a number and rounds/reformats unexpectedly instead of a string.
Diagnostic Workflow
Check which Compose you are actually running — v1 and v2 treat version: very differently:
docker compose version
docker-compose version
Ask Compose to parse and normalize the file; this reports the exact offending value:
docker compose config
The legacy form that triggers the error or warning:
version: "3.8" # obsolete on Compose v2
services:
web:
image: registry.example.com/myapp:1.4.2
ports:
- "8080:8080"
The modern, versionless form Compose v2 expects — simply remove the line:
services:
web:
image: registry.example.com/myapp:1.4.2
ports:
- "8080:8080"
Re-validate and start:
docker compose config
docker compose up -d
Example Root Cause Analysis
A platform team maintained a fleet of servers with mixed Docker versions. Their canonical docker-compose.yml began with version: "2", a holdover from an early deployment. On a host still running the legacy docker-compose v1 binary, upgrading the file to use a newer feature caused v1 to complain the schema version was too low; on a host running Compose v2, the version: "2" key was flagged as unsupported/obsolete.
The team was effectively caught between two eras: one binary demanded a version key, the other rejected it. Their resolution was to standardize on Compose v2 across the fleet (installing docker-compose-plugin everywhere), delete the version: key from the file entirely, and run docker compose config in CI to prove the versionless file parsed cleanly. With v1 fully retired, the version: key had no reason to exist, and the “unsupported” error could not recur.
Prevention Best Practices
- Delete the
version:key from all Compose files targeting Compose v2 — it is obsolete and only a liability. - Standardize on Compose v2 across every host so one file parses identically everywhere; retire the
docker-composev1 binary. - Run
docker compose configin CI to catch schema and version issues before deploy. - Quote string-like values when you must keep them, so YAML never reinterprets
3.8as a float. - Update legacy tutorials before copying them — many still show
version:headers that no longer apply. See the Dockerfile & Compose validator.
Quick Command Reference
# Identify your Compose implementation
docker compose version
docker-compose version
# Parse and normalize the file (reports the bad version)
docker compose config
# After removing the version: line
docker compose up -d
Conclusion
Version in "./docker-compose.yml" is unsupported comes from the obsolete top-level version: key. On Compose v2 the schema is versionless, so the safest, most durable fix is to delete the line and let Compose parse the file as-is. Standardize your hosts on Compose v2, remove version: everywhere, and validate with docker compose config so this legacy error stays gone.
Fixed it? Get 500 Docker with AI & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Stuck on this? Start guided troubleshooting
Open an interactive diagnostic session with this error already loaded. Work a step-by-step plan, record what each check returns, land on a root cause, and export a clean incident summary — no account needed to start.
Did this fix your issue?
Solved it a different way?
Share the fix that worked for you — reviewed, then published to help the next engineer.
That looks like it may contain a secret (key, token, password, or connection string). Please remove it — a note with a detected secret can’t be published.
Thanks — that helps. Published notes appear after a quick review.
Trending errors this week
The error guides other engineers are actually reading right now.
- 1mount: wrong fs type, bad option, bad superblock
- 2Docker 'failed to set up container networking': Fix the Bridge and IP Pool
- 3Docker 'failed to create shim task': How to Fix the containerd Runtime Error
- 4Transport endpoint is not connected
- 5modprobe: FATAL: Module not found
- 6mount: wrong fs type, bad option, bad superblock
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.