docker-compose : Unsupported config option for services service: 'web'

China☆狼群 提交于 2020-01-12 11:56:26

问题


I am going through getting started page for docker-compose: https://docs.docker.com/compose/gettingstarted/

In Step 3, I made a docker-compose.yml file as described:

version: '2'
services:
    web:
        build: .
        ports: 
            - "5000:5000"
        volumes: 
            - .:/code
        depends_on:
            - redis
    redis:
        image: redis

But when I run:

$ docker-compose up

I get following error:

Unsupported config option for services service: 'web'

I am not able to figure out what is going on. Any help?

Thank you


回答1:


Support for the version 2 compose file format was introduced in docker-compose version 1.6, released around February of this year.

You're using 1.3.3, from July 2015.

You need to upgrade to a more recent version to use the version 2 format configuration files.



来源:https://stackoverflow.com/questions/36724948/docker-compose-unsupported-config-option-for-services-service-web

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!