Alo*_*lon 2 ubuntu docker docker-compose
我在 Ubuntu 20.04 虚拟机中使用 docker-compose。我的 docker-compose 版本是docker-compose version 1.25.0, build unknown. 当我尝试构建时,出现以下错误:
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 supported version (e.g "2.2" or "3.3") 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/
Run Code Online (Sandbox Code Playgroud)
如何在 Ubuntu 上升级到最新版本的 docker-compose 来解决这个问题?
该文件如下所示:
version: "3.8"
services:
...
networks:
...
Run Code Online (Sandbox Code Playgroud)
如果您不使用“3.8”中的功能,最简单的方法是降级“docker-compose.yml”中的版本号。对于1.25.0版本,它看起来不大于“3.7”或“2.4”。
要升级您的 compose 安装,git 存储库上的自述文件提供了用于安装 docker-compose 的各种选项。在该命令捆绑到 Linux 安装中之前,我的偏好docker compose是使用pip install docker-compose.
| 归档时间: |
|
| 查看次数: |
7660 次 |
| 最近记录: |