0

This is my docker-compose.yaml

version: '2'
services:
  databases:
   image: mysql
   ports:
   - "3306:3306"
   environment:
   - MYSQL_ROOT_PASSWORD=password
   - MYSQL_USER=user
   - MYSQL_PASSWORD=password
   - MYSQL_DATABASE=demodb
web:
   image: nginx

Error: The Compose file ./docker-compose.yml' is invalid because: Additional properties are not allowed('web' was unexpected)

And on the bottom part it says that this is maybe because of the docker-compose version, but on docker website it says that docker on windows come with docker-compose and don't need to be installed separately.

1 Answer 1

1

Issue is your indentation for web, please align it with the same level as databases service as per below. Then I manage to run docker-compose up

version: '2'
services:
   databases:
     image: mysql
     ports:
       - "3306:3306"
     environment:
       - MYSQL_ROOT_PASSWORD=password
       - MYSQL_USER=user
       - MYSQL_PASSWORD=password
       - MYSQL_DATABASE=demodb
   web:
     image: nginx
1
  • Thank you, I don't know how I missed that. Commented Dec 3, 2017 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.