Docker-Compose file has yaml.scanner.ScannerError

后端 未结 17 2119
情话喂你
情话喂你 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:39

    Literally found the solution seconds later. You have to remove the "discovery-microservice" after "build":

    version: '2'
    services:
      discovery-microservice:
        build:
          context: ./discovery-microservice/target/docker
          dockerfile: Dockerfile
        ports:
         - "8761:8761"
    

    Also you can use "./" in context for relative paths. :)

提交回复
热议问题