不支持docker-compose中的版本 [英] Version in docker-compose is unsupported

查看:265
本文介绍了不支持docker-compose中的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装 docker-compose配置。如您所见,它具有版本3。
当我使用 docker-compose build --pull 运行它时,出现此错误:

I try to install this docker-compose configuration. As you can see, it has version 3. When I run this with docker-compose build --pull, I got this error:

ERROR: Version in "./docker-compose.yml" is unsupported. 
You might be seeing this error because you're using the wrong Compose file version. 
Either specify a version of "2" (or "2.0") and place your service definitions 
under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

如果我从.yml中删除了版本,则会出现这样的错误:

If I remove version from .yml, then I get such error:

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for volumes: 'conf.d'
Unsupported config option for services: 'letsencrypt-companion'
Unsupported config option for networks: 'proxy-tier'

阅读文档后首先想到的是版本不兼容。所以我已经将docker更新为 17.9.1-ce

这是 docker-compose

After reading documentation my first thoughts was about version incompatibility. So I've updated docker to 17.9.1-ce.
And here is version of docker-compose:

docker-compose version 1.8.0, build unknown

但是错误是相同的,我对此一无所知。
操作系统:Ubuntu 17.10。

But errors are the same and I really have no idea about this. Operation System: Ubuntu 17.10.

推荐答案

您需要升级docker compose以及可能的docker引擎。 Docker compose 3.0文件需要Docker引擎1.13.0+版本(以及该版本的compose)。有关更多信息,请参见: https://docs.docker.com/compose/compose-file/ ,特别是Compose和Docker Engine兼容性列表。

You need to upgrade docker compose and possibly the docker engine. Docker compose 3.0 files require docker engine version 1.13.0+ (and that version of compose). For more information see: https://docs.docker.com/compose/compose-file/, specifically the Compose and Docker Engine compatibility matrix.

请注意,版本1.18.0在版本1.8.0之后。它是1.18.0版,而不是1.1.8.0版。次要版本号一直在增加(例如1.8.0-> 1.9.0-> 1.10.0-> 1.11.0)。

Please note that version 1.18.0 comes after versions 1.8.0. It's version 1.18.0, not version 1.1.8.0. The minor version number just keeps increasing (e.g. 1.8.0 -> 1.9.0 -> 1.10.0 -> 1.11.0).

最新版本(撰写本文时)为1.18,于2017年12月19日发布,1.8为2017年7月27日发布( https://github.com/docker/compose/releases )。您正在使用与docker-compose 3个文件不兼容的docker的旧版本。

The latest version (when writing this) is 1.18, released on December 19 2017, 1.8 was released on July 27 2017 (https://github.com/docker/compose/releases). You are using an old version of docker that is not compatible with docker-compose 3 files.

此外,它们更改了docker别名的编号以反映发布日期: 17.9.0是2017年9月版本(第一个数字是年份,第二个数字是月份)。

Also, they changed the numbering of the docker enigines to reflect the release date: 17.9.0 is the September 2017 release (first number is the year, second number is the month).

这篇关于不支持docker-compose中的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆