1、下载docker-compose文件  ,若下载慢,可以先下载到本地,然后传到对应的目录

curl -SL https://github.com/docker/compose/releases/download/v2.24.4/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

2、给执行权限

sudo chmod +x /usr/local/bin/docker-compose

3、创建软连

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

4、验证是否安装成功

sudo docker-compose –version