Docker-Compose file has yaml.scanner.ScannerError

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

    I encountered a similar issue today, a syntax error in the docker-compose.yml file that caused the same error.

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

    Removing this line // Add your services here fixed my issue

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

    I hope this helps someone with a similar issue.

提交回复
热议问题