Docker-Compose file has yaml.scanner.ScannerError

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

    Using the vs code yaml RedHat extension, I saw I was off by one indent:

    Wrong:

    version: '3'
    
    services:
    
      web:
        image: nginx
         ports:
        - 9090:80
    
      database:
        image: redis
    

    Right:

    version: '3'
    
    services:
    
      web:
        image: nginx
        ports:
        - 9090:80
    
      database:
        image: redis
    

提交回复
热议问题