docker compose v2 は version の key を見ていない
code:shell
$ docker compose version
Docker Compose version 2.26.0
code:sh
$ head -n1 docker-compose.yml
version: '3'
code:sh
$ docker compose build
WARN0000 /Users/ikaruga/src/github.com/ikaruga777/rails-tutorial-sample-app/docker-compose.yml: version is obsolete docker compose コマンドは version の key をもう見ていないのです。
Version two of the Docker Compose command-line binary was announced in 2020, is written in Go, and is invoked with docker compose. Compose V2 ignores the version top-level element in the compose.yml file.