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.
WARN[0000] /app/docker-compose.yml: the attribute `version` is obsolete,
it will be ignored, please remove it to avoid potential confusionCommon 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.
# delete this line from docker-compose.yml
version: "3.8"Standardize on Compose v2
- Use
docker compose(space) everywhere, not the legacydocker-composebinary. - Confirm the version with
docker compose version. - 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 composeplugin consistently in CI. - Do not let the warning distract from real errors in the log.