Skip to content
Latchkey

Docker Compose "the attribute version is obsolete" Warning

The top-level version: key in compose files is obsolete in Compose v2 and is ignored. The warning itself is harmless - but it often appears right next to a real v1-vs-v2 problem.

What this error means

Every docker compose command prints the attribute "version" is obsolete, it will be ignored. The command still runs; the noise can mask a more important error in the same output.

docker compose output
WARN[0000] /app/docker-compose.yml: the attribute `version` is obsolete,
it will be ignored, please remove it to avoid potential confusion

Common causes

Legacy `version:` key in the compose file

Compose v2 derives the schema from the features used, so the old version: "3.8" declaration is ignored and warned about.

Mixing Compose v1 commands/behavior

Pipelines that still call docker-compose (v1, hyphenated) alongside docker compose (v2) can behave inconsistently; the warning is a hint you are on the v1→v2 boundary.

How to fix it

Remove the version key

Delete the top-level version: line to silence the warning.

docker-compose.yml
# delete this line from docker-compose.yml
version: "3.8"

Standardize on Compose v2

  1. Use docker compose (space) everywhere, not the legacy docker-compose binary.
  2. Confirm the version with docker compose version.
  3. Treat the obsolete-version line as a warning, and scan the same output for the actual error.

How to prevent it

  • Drop the version: key from compose files.
  • Use the v2 docker compose plugin consistently in CI.
  • Do not let the warning distract from real errors in the log.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →