Version in “./docker-compose.yml” is unsupported解决方式

QioCuIi 1.7K 0
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/

今天在部署一个docker项目时,发生了此报错,排查后发现主要原因是docker-compose版本太低了,和/docker-compose.yml 要求的版本对应不上[aru_49]。

Version in

Version in

解决方案:

进行docker-compose版本升级,直接在github上下载最新版本的程序,对老版本进行覆盖。

注意事项:

首先先查询文件所在路劲,不同系统可能所在位置不同,本次操作系统为centos7,请在确认后再进行操作!

查询所在路劲:

whereis docker-compose

bash:

Version in

下载:

wget "https://ghproxy.com/https://github.com/docker/compose/releases/download/最新版本/docker-compose-linux-x86_64" -O /文件所在路径/docker-compose

示例:

wget "https://ghproxy.com/https://github.com/docker/compose/releases/download/v2.10.1/docker-compose-linux-x86_64" -O /usr/bin/docker-compose

Version in

提权:

chmod +x docker-compose
docker-compose --version

end![aru_53]
Version in

发表评论 取消回复
表情 图片 链接 代码

分享