在线安装
- 国内镜像秒下载
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
如果遇到版本更新,把版本数字更改一下就可以了
- 修改文件执行权限
sudo chmod +x /usr/local/bin/docker-compose
- 创建软链
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- 测试是否安装成功
docker-compose --version cker-compose version 1.24.1, build 4667896b
离线安装
- GitHub下载
- 将下载的“docker-compose-Linux-x86_64”文件上传到服务器/usr/local/bin,并改名为“docker-compose”
sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
- 添加可执行权限
sudo chmod +x /usr/local/bin/docker-compose
- 测试
docker-compose -v