docker-compose版本过低如何升级

2022-11-05 10:24:55 浏览数 (1)

docker-compose up -d这步报错如下

ERROR: Version in "./docker-compose.yaml" 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-compose --version #查看当前docker-compose版本

yum update # 升级所有包(改变软件设置和系统设置,系统版本内核都升级 ,不小心输入的,运行完后发现内存多了8G,清理垃圾神器

whereis docker-compose #查看docker-compose的安装路径

yum remove docker-compose #卸载docker-compose

发现一个很棒的网站DaoCloud | Docker 极速下载提供下列方法

Docker Compose 存放在Git Hub,不太稳定。

你可以也通过执行下面的命令,高速安装Docker Compose。

curl -L https://get.daocloud.io/docker/compose/releases/download/v2.9.0/docker-compose-uname -s-uname -m > /usr/local/bin/docker-compose chmod x /usr/local/bin/docker-compose

你可以通过修改URL中的版本,可以自定义您的需要的版本。

0 人点赞