Read more

How to fix: Version in "./docker-compose.yml" is unsupported

Emanuel
January 27, 2021Software engineer at makandra GmbH

When running an older version of docker-compose you might see the following error:

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.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
$ cat ./docker-compose.yml
version: '3.3'
...
Illustration money motivation

Opscomplete powered by makandra brand

Save money by migrating from AWS to our fully managed hosting in Germany.

  • Trusted by over 100 customers
  • Ready to use with Ruby, Node.js, PHP
  • Proactive management by operations experts
Read more Show archive.org snapshot

You can fix this issue by upgrading docker-compose Show archive.org snapshot to the newest version (just download the new script from the install section). Make sure you uninstall the any previous apt package before coping the script via curl sudo apt remove docker-compose.

Check your docker-compose version

$ docker-compose --version                                                                                                                                                                                
docker-compose version 1.17.1, build unknown

$ docker-compose version
docker-compose version 1.17.1, build unknown
docker-py version: 2.5.1
CPython version: 2.7.17
OpenSSL version: OpenSSL 1.1.1  11 Sep 2018

Notice that the --version output still might references to the old version (maybe some bug in 1.28.2).

$ docker-compose version                                                                                                                                                                               
docker-compose version 1.28.2, build 67630359
docker-py version: 4.4.1
CPython version: 3.7.9
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

$ docker-compose --version                                                                                                                                                                         
docker-compose version 1.17.1, build unknown
Posted by Emanuel to makandra dev (2021-01-27 15:25)