ERROR: In file './docker-compose.yml', volume must be a mapping not a string

后端 未结 8 1791
清歌不尽
清歌不尽 2020-12-09 02:31

Question: Why do I get this error?

ERROR: In file \'./docker-compose.yml\', volume \'mariavolume\' must be a mapping not a string.

相关标签:
8条回答
  • 2020-12-09 03:27

    For me this works:

    In #docker_compose.yml:

    volumes:
      postgres_data: {}
      static: { }
    
    0 讨论(0)
  • 2020-12-09 03:30

    Try this:

    version: '2'
    services:
      ...
      db:
        image: mariadb
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: example
        volumes:
          - ~/mariadb:/var/lib/mysql
    
    0 讨论(0)
提交回复
热议问题