Compose v2 is run as
docker compose, and the top-level version key is obsolete and ignoredCompose v2 is run as docker compose, and the version key is obsolete. Compose v2 is a plugin for the Docker CLI. It follows the Compose Specification, where version is no longer used. If the key is there, Compose only prints a warning.
"The version key is required and decides which features are available" is wrong for this reason. "You must set version: "4" to use depends_on conditions" is also wrong: features such as depends_on conditions don't depend on any version number. "Files without version are treated as the old v1 format" is wrong too, because Compose v2 ignores the key.
Read more