docker-compose :不支持的服务配置选项:'web' [英] docker-compose : Unsupported config option for services service: 'web'
问题描述
我正在阅读Docker Compose 入门页面.
I am going through the Getting Started with Docker Compose page.
在第 3 步中,我创建了一个 docker-compose.yml
文件,如下所述:
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
但是当我跑步时:
$ docker-compose up
我收到以下错误:
不支持的服务配置选项:'web'
Unsupported config option for services service: 'web'
我做错了什么?我无法弄清楚发生了什么.
What am I doing wrong? I was not able to figure out what is going on.
推荐答案
docker-compose 中引入了对版本 2 撰写文件格式的支持 1.6 版,今年 2 月左右发布.
Support for the version 2 compose file format was introduced in docker-compose version 1.6, released around February of this year.
您使用的是 2015 年 7 月的 1.3.3.
You're using 1.3.3, from July 2015.
您需要升级到更新的版本才能使用版本 2 格式的配置文件.
You need to upgrade to a more recent version to use the version 2 format configuration files.
这篇关于docker-compose :不支持的服务配置选项:'web'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!