Let’s take a look at the not so common Docker Compose error:
"Configuration 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/"
The solution is quite obvious, so let’s dive into it.
- Docker Compose
Step 1. Remove the current Docker Compose version first.
sudo apt-get remove docker-compose
Step 2. Install the latest Docker Compose version, by following the official guide.
Note: Two other things to try if this doesn’t work though.
- Upgrade the Docker engine too.
- Try to downgrade. Specify an older docker-compose file version. For instance, if you are still getting the same error for version ‘3.8’, try with version number ‘3.7’, and so on ..you get me.
If you can think of any alternative solution, feel free to write a comment below. On a side note, follow our official channel on Telegram.