Docker Community Forums

Share and learn in the Docker community.

Errors on docker-compose up : parser error


(Ralph Kincade) #1

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


(Nathan Le Claire) #2

My guess: indentation errors. Try:

version: '2'

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

(Ralph Kincade) #3

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!!!


(Nathan Le Claire) #4

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