Errors on docker-compose up : parser error

I am attemptiing to run this in a docker-compose.yml file

version: '2’
services:
javaclient:
build: .
redis:
image: redis
container_name: redisdb

but I get this error when I attempt to run “docker-compose up”

any idea ? thanks !!!
RROR: yaml.parser.ParserError: while parsing a block mapping
in “./docker-compose.yml”, line 1, column 1
expected , but found ''
in “./docker-compose.yml”, line 2, column 5

My guess: indentation errors. Try:

version: '2'

services:
  javaclient:
    build: .
  redis:
    image: redis
    container_name: redisdb

yeah that works, , could you point me to any document that explicitly tells me how to format the yml file . as in what should line up with what I am in a kinda fog about that

thanks!!!

https://docs.docker.com/compose/compose-file/ for examples of Compose in particular
http://yaml.org/ for details on YAML
http://www.yamllint.com/ to check YAML

I had the same problem and it didn’t work for me until I added a blank line to to top of my .yml file.

The error in your YAML file could be due to the incorrect usage of the single quote in the version declaration (version: '2’). Specifically, the closing quote seems to be a right single quotation mark (), instead of a standard single quote ('). This can cause YAML to throw an error.

Please visit following website to capture exact error :- validate yaml