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

后端 未结 8 1789
清歌不尽
清歌不尽 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:06

    Unfortunately, there is no such a feature.

    You can’t map a top-level volume in docker-compose.

    Here are the options:

    • Adding volume per container and map it there. (like what Daniel did here)
    • Create a volume outside of the compose (with mapping) and use it in your compose.

      volumes:
         maria_volume: 
             external:
                 name: volume-name
      

提交回复
热议问题