ERROR: Version in "./docker-compose.yaml" is unsupported.

Hi,

I’m running OpenSUSE Leap 15.3 on my workstation.

I want to install a local test lab which relies on Docker and Docker Compose:

https://github.com/spurin/diveintoansible-lab

I installed Docker and Docker Compose:

# zypper install docker python3-docker-compose

I enabled Docker:

# systemctl enable docker --now

I downloaded the course files:

# git clone https://github.com/spurin/diventoansible-lab

I changed into the newly created directory and edited the hidden .env file accordingly.

Now when I run Docker Compose, I get the following error:


$ docker-compose up 
ERROR: Version in "./docker-compose.yaml" is unsupported. You might be seeing this error becau
se 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` k
ey 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
/

Any idea what’s wrong here?

Cheers,

Niki

docker-compose that ships with 15.3 is too old to support Compose version 3.8.

I would say the best course of action is to install docker-compose using pip3 (python3 installer) but first uninstall the existing python3-docker-compose because it’s too old and might conflict.


pip3 install docker-compose

If you do not have pip3 installed, install package called python3-pip

Install might take a few moments and download some files, then you should have an up to date docker-compose.