docker compose 升级
docker-compose 升级
如果遇到这样的问题,就需要升级了
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.
whereis docker-compose
/usr/bin/docker-compose
根据上一步的whereis
找到了docker-compose的路径为:/usr/bin/docker-compose
,所以下面的脚本,路径也替换为这个就可以了。
下载一个
快速连接:
wget https://gitee.com/wang-huamao/soft/raw/master/docker/docker-compose-linux-x86_64-2.24.6
官方连接:
https://github.com/docker/compose/releases/
或直接下载centos地址
https://github.com/docker/compose/releases/download/v2.24.6/docker-compose-linux-x86_64
改名
mv docker-compose-linux-x86_64 docker-compose
chmod +x docker-compose
mv docker-compose /usr/bin/
检查
docker-compose version