docker-compose中的版本不受支持

我尝试安装这个 docker-composeconfiguration。 正如你所看到的,它有版本3.当我用docker-compose build --pull运行这个时,我得到这个错误:

 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中删除版本,那么我得到这样的错误:

 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版本:

 docker-compose version 1.8.0, build unknown 

但错误是一样的,我真的不知道这一点。 操作系统:Ubuntu 17.10。

您需要升级docker工人,也可能是docker工人。 Docker compose 3.0文件需要docker引擎版本1.13.0+(以及该版本的撰写)。 有关更多信息,请参阅: https : //docs.docker.com/compose/compose-file/ ,特别是Compose和Docker Engine兼容性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)。

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

此外,他们更改了泊坞窗的编号,以反映发布date:17.9.0是2017年9月发布的版本(第一个数字是年份,第二个数字是月份)。