Docker-compose报错:Unsupported config option for services: 'web'

用dokcer-composer启动我的flask镜像,出现了报错:

ERROR: The Compose file './docker-compose.yml' is invalid because:

Unsupported config option for services: 'web'

查了资料之后发现,配置文件需要和docker-compose的版本一致才能被解析

比如我的docker-compose version 1.19.0,version 就为2

version: '2'

services:

    web:

        image: ubuntu-with-flask:latest

        volumes:

            - /docker/eyetech:/code

        ports:

            - "5000:5000"

        command: python3 hello.py

你可能感兴趣的:(Docker-compose报错:Unsupported config option for services: 'web')