Why does my Docker composer not work with volume? I'm trying to create a volume to be shared among the containers, and this volume binds to a location of my host, the problem is that every time I run the docker-compose up gives the  following error: 

In file '. \ docker-compose.yml', service 'volumes' must be a mapping not an array.


and so far I didn't understand why.  Following is the compose file:


version : '3.4'

services:
    testando-volume-compartilhado-a:
      image: carloshenriquecarniatto/teste:latest

    volumes:
       - D:\App:/app
    ports:
        - "10001:80"
        - "44378:443"
It seems there is a spacing issue in your yaml

You should change the compose file to

version : '3.4'

services:
    testando-volume-compartilhado-a:
      image: carloshenriquecarniatto/teste:latest

    volumes:        
        - D:\App:/app  # &lt;- extra space here
    ports:
        - "10001:80"
        - "44378:443"