Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-Compose file has yaml.scanner.ScannerError

compose.yml file, which looks like this:

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

While I am executing it I get the following error:

yaml.scanner.ScannerError: mapping values are not allowed here in "C:\...\docker-compose.yml", line 5, column 14 

From what I see, nothing is wrong with the format, e.g. whitespaces missing. My overall goal is to specify a development mode docker-compose file, pointing it to the target directories from the different modules.
What am I doing wrong here?

like image 556
Skeffington Avatar asked Aug 22 '16 10:08

Skeffington


1 Answers

Ok, I wasted around 3 hours to debug a similar issue.

If you guys ever get the below error

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here in ".\docker-compose.yml", line 2, column 9 

It's because a space is needed between

version:'3' <-- this is wrong

version: '3' <-- this is correct.

Also, if you are using eclipse, do yourself a favor and install the YEdit YAML editor plugin

like image 149
virtuvious Avatar answered Sep 28 '22 16:09

virtuvious