Docker Community Forums

Share and learn in the Docker community.

Docker-compose.yml' is invalid because: Unsupported config

docker

(Sudheshpn) #1

I am getting the below exception while running docker-compose up. I am using docker-compose version 1.9.0 and the version is: ‘2.0’. Can someone please help me.

#docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.show: 'dockerfile'
services.show.build contains an invalid type, it should be a string, or an object
services.movies.build contains unsupported option: 'networks'

Docker Compose yml file

version: '2.0'
services:
    movies:
      build:
        context: .
        dockerfile: Dockerfile-movies
        networks:
          - blockmyshownet
        ports:
          - "5001:5001"
        volumes:

          - movie_vol:/code
    show:
        build:
        context: .
        dockerfile: Dockerfile-show
        networks:
          - blockmyshownet
        ports:
            - "5002:5002"
        volumes:

            - movie_vol:/code

volumes:
  movie_vol:
networks:
  blockmyshownet:
    driver: bridge


(Christian Kniep) #2

your indentation is slightly off.

The second is missing the indentation for the build options. The first should put networks and the rest on the same level then build.

show:
   build:
     context: .
     dockerfile: Dockerfile-show
   networks:

(Sudheshpn) #3

Thanks that worked. As you said yaml format was incorrect.Used Visual studio to write the yml code!