Hello,
it seems that you are using a pretty old version of docker - on my dev-system I am using docker version 28.2.2. So best would be to update your docker-installation to an up-to-date version.
Alternative is to check if you can use docker-compose instead of docker compose. But this comes with a minimal different format for the docker-compose.yml - at least it has to start with a version: 3 (or whatever version of docker-compose.yml you are using).