Skip to main content
Added Richard's suggestion; Post Made Community Wiki
Source Link
Bruce Becker
  • 3.7k
  • 4
  • 19
  • 41

You are providingIt seems there is a list instead of an arrayspacing issue in the volumes. This is clear from the error message:your yaml

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

You should change the compose file to

version : '3.4'

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

    volumes:        # <-- not a 
 list any more
      - D:\App:/app  # <- extra space here
    ports:
        - "10001:80"
        - "44378:443" 

You are providing a list instead of an array in the volumes. This is clear from the error message:

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

You should change the compose file to

version : '3.4'

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

    volumes:        # <-- not a list any more
       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  # <- extra space here
    ports:
        - "10001:80"
        - "44378:443" 
Remove whitespace
Source Link
Richard Slater
  • 11.7k
  • 7
  • 42
  • 81

You are providing a list instead of an array in the volumes. This is clear from the error message:

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

You should change the compose file to


 version : '3.4'

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

    volumes:        # <-- not a list any more
       D:\App:/app  # 
    ports:
        - "10001:80"
        - "44378:443" 

You are providing a list instead of an array in the volumes. This is clear from the error message:

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

You should change the compose file to


 version : '3.4'

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

    volumes:        # <-- not a list any more
       D:\App:/app  # 
    ports:
        - "10001:80"
        - "44378:443" 

You are providing a list instead of an array in the volumes. This is clear from the error message:

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

You should change the compose file to

version : '3.4'

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

    volumes:        # <-- not a list any more
       D:\App:/app  # 
    ports:
        - "10001:80"
        - "44378:443" 
Source Link
Bruce Becker
  • 3.7k
  • 4
  • 19
  • 41

You are providing a list instead of an array in the volumes. This is clear from the error message:

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

You should change the compose file to


version : '3.4'

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

    volumes:        # <-- not a list any more
       D:\App:/app  # 
    ports:
        - "10001:80"
        - "44378:443"