Hi There,
I am running Docker compose build and getting error - ‘services must be a mapping’.
I googled and referred similar issue. But still no luck.
Can you please help?
My YAML file content is given below.
I am on Windows 10.
My Docker version 20.10.14, build a224086
Docker Compose version v2.5.0
Please, use the code block button (</>) to insert source codes or anything in which the proper indentation is important or contains special characters which means something in MarkDown. I fixed your post.
There are multiple problems here.
First of all, the version doesn’t seem right. That version was the version of the compose file not the version of Docker Compose as a software. Docker Compose v2 does no require a version number in the compose file anyway, so remove that line.
The other problem is the indentation. “web” and “nginx” should be indented like this: