Docker-Compose file has yaml.scanner.ScannerError

后端 未结 17 2063
情话喂你
情话喂你 2021-02-01 12:04

compose.yml file, which looks like this:

version: \'2\'
services:
  discovery-microservice:
    build: discovery-microservice
      context: /discov         


        
17条回答
  •  盖世英雄少女心
    2021-02-01 12:45

    I wanted a volume mapped to a specific path on the external (host) server. I tried putting that under the top-level volumes entry in docker-compose.yml. After looking at the docker-compose file docs, I realized that that type of volume does not go there. Instead, it goes only under the volumes entry within the container definition. E.g.:

    version: "3.7"
    services:
      web:
        image: my_custom_web_image
        build: ./app
        volumes:
          - ./app/subdir:/usr/src/app/subdir
    

提交回复
热议问题