Docker撰写文件:
version: '2'
services:
wordpress:
image: wordpress
ports:
-8080:80
environment:
WORDPRESS_DB_PASSWORD:vvk123
mysql:
image:mysql:latest
environment:
MYSQL_ROOT_PASSWORD:vvk123
当我试图执行此命令时
docker-compose ps
其给出的错误称为
yaml.scanner.ScannerError:此处不允许映射值 “。\ docker-compose.yml”,第12行,第20列
答案 0 :(得分:1)
尝试在第12行的列之后添加一个空格:
version: '2'
services:
wordpress:
image: wordpress
ports:
- 8080:80
environment:
- WORDPRESS_DB_PASSWORD:vvk123
mysql:
image: mysql:latest
environment:
- MYSQL_ROOT_PASSWORD:vvk123