当我尝试撰写时,我得到了这个:
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"
....
根本看不到任何错误的语法
答案 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"