【问题标题】:Docker compose: expected a mapping or list of mappings for merging, but found scalarDocker compose:需要一个映射或映射列表以进行合并,但找到了标量
【发布时间】:2020-06-19 04:59:36
【问题描述】:

我正在尝试使用以下指南在 Windows 环境下在 Docker 上设置 Redash:

https://medium.com/@ikishan/creating-a-new-age-dashboard-with-self-hosted-open-source-redash-41e91434390

但是当我到达以下步骤时:

docker-compose run --rm server create_db

我收到此错误:

ERROR: yaml.constructor.ConstructorError: while constructing a mapping in ".\docker-compose.yml", line 1, column 1

expected a mapping or list of mappings for merging, but found scalar in ".\docker-compose.yml", line 2, column 19

前两行在 docker-compose.yml 中配置如下:

1: version: ‘2’

2: x-redash-service: &redash-service

第 2 行的第 19 列是“&”。

这个错误的根源是什么?

【问题讨论】:

    标签: docker docker-compose yaml redash


    【解决方案1】:

    原来身份完全被破坏了:

    version: '2'
    x-redash-service: &redash-service
      image: redash:latest
      depends_on:
        - postgres
        - redis
      env_file: redash.env
      restart: always
    services:
      server:
        <<: *redash-service
        command: server
        ports:
          - "5000:5000"
        environment:
          REDASH_WEB_WORKERS: 4
      scheduler:
        <<: *redash-service
        command: scheduler
        environment:
          QUEUES: "celery"
          WORKERS_COUNT: 1
      scheduled_worker:
        <<: *redash-service
        command: worker
        environment:
          QUEUES: "scheduled_queries,schemas"
          WORKERS_COUNT: 1
      adhoc_worker:
        <<: *redash-service
        command: worker
        environment:
          QUEUES: "queries"
          WORKERS_COUNT: 2
      redis:
        image: redis:latest
        restart: always
      postgres:
        image: postgres:latest
        env_file: redash.env
        restart: always
      nginx:
        image: redash/nginx:latest
        ports:
          - "80:80"
        depends_on:
          - server
        links:
          - server:redash
        restart: always
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-24
      • 2011-12-04
      • 1970-01-01
      • 2021-05-02
      • 1970-01-01
      • 1970-01-01
      • 2019-08-23
      • 2022-10-17
      相关资源
      最近更新 更多