簡體   English   中英

docker-compose中的版本不受支持

[英]Version in docker-compose is unsupported

我嘗試安裝這個 docker-compose配置。 正如你所看到的,它有版本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'

閱讀文檔后,我的第一個想法是版本不兼容。 所以我將17.9.1-ce更新為17.9.1-ce
這里是docker-compose版本:

docker-compose version 1.8.0, build unknown

但錯誤是一樣的,我真的不知道這個。 操作系統:Ubuntu 17.10。

您需要升級docker compose以及docker引擎。 Docker compose 3.0文件需要docker engine version 1.13.0+(以及那個版本的compose)。 有關更多信息,請參閱: https//docs.docker.com/compose/compose-file/ ,特別是Compose和Docker Engine兼容性矩陣。

請注意,版本1.8.0之后是版本1.18.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。

此外,他們更改了docker enigines的編號以反映發布日期:17.9.0是2017年9月發布(第一個數字是年份,第二個數字是月份)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM