To run 3.9 version on ubuntu VM

I am running docker compose file version 3.9 on ubuntu VM on GCP. I get the following error :

Version in “./docker-compose.yml” is unsupported. You might be seeing this error because you’re using the wrong Compose file version. Either specify a supported version (e.g “2.2” or “3.3”) and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.

Can some one please suggest right docker engine and docker compose to run version 3.9 on ubuntu VM on GCP?

Sure, we can run google for you:

search terms: “docker compose release”, returns a link to Docker Compose release notes | Docker Documentation. If you use strg+f to search for “3.9”, you get here “Docker Compose release notes | Docker Documentation”. Any version >= 1.27.1 should support the schema.

search terms: “docker compose compatiblity matrix”, returns a link to Compose file versions and upgrading | Docker Documentation, which does not list 3.9, which indicates that it needs to be newer than 19.03.x, You should be good with 20.10.x

The specific question for schema version 3.9 makes me wonder which particular feature I missed out that makes it necessary to use 3.9…