yss0 2019-07-01
ERROR: yaml.parser.ParserError: while parsing a block mapping in "./docker-compose.yml", line 15
version: '2' services: # PostgreSQL mydb: image: postgres:10 ports: - "5432:5432" environment: - POSTGRES_DB=postgres - POSTGRES_USER=odoo - POSTGRES_PASSWORD=odoo volumes: - odoo-db-data:/var/lib/postgresql/data # Odoo web web: build: context: ../odoo_demo dockerfile: Dockerfile hostname: web command: ./docker_run_web.sh volumes: - ../odoo_demo:/app # mount current directory inside container - odoo-web-data:/app/odoo-web-db # 把此路径/app/odoo-ee-web-db配置到odoo conf data_dir参数中 ports: - "8069:8069" # set up links so that web knows about db, rabbit and redis depends_on: - mydb volumes: odoo-web-data: odoo-db-data:
docker-compose up -d
ERROR: yaml.parser.ParserError: while parsing a block mapping in "./docker-compose.yml", line 15, column 5 expected <block end>, but found '<block mapping start>' in "./docker-compose.yml", line 25, column 4
原因文件内块对齐有问题,使用notepad++打开查看如下:
volumes:
- ../odoo_demo:/app # mount current directory inside container - odoo-web-data:/app/odoo-web-db # 把此路径/app/odoo-ee-web-db配置到odoo conf data_dir参数中
在下面这句话前面添加两个空格,使他能和上面保持对其
- odoo-web-data:/app/odoo-web-db # 把此路径/app/odoo-ee-web-db配置到odoo conf data_dir参数中