Docker-Compose文件有yaml.scanner.ScannerError但我什么都看不到

时间:2017-11-16 14:56:05

标签: docker docker-compose yaml

当我尝试撰写时,我得到了这个:

    yaml.scanner.ScannerError: mapping values are not allowed here
  in "./docker-compose.yml", line 6, column 15

我的docker-compose.yml:

version: '2'

services:
    fhem:
        restart:always
        expose:
            - "8083"
            - "7072"
        ports:
            - "8083:8083"
            - "7072:7072"
        build: fhem
        privileged: true
        devices:
          - "/dev/ttyUSB0:/dev/ttyUSB0"
       ....

根本看不到任何错误的语法

1 个答案:

答案 0 :(得分:0)

restart之后的冒号(@bartimar)之后缺少空格,并且您的设备行没有正确缩进,因为您使用了4个空格缩进。

version: '2'

services:
    fhem:
        restart: always
        expose:
            - "8083"
            - "7072"
        ports:
            - "8083:8083"
            - "7072:7072"
        build: fhem
        privileged: true
        devices:
            - "/dev/ttyUSB0:/dev/ttyUSB0"