1. 对应版本
https://docs.docker.com/compose/compose-file/compose-file-v3/
参考:https://github.com/docker/compose/releases
2. 安装
国内源安装(不推荐):
curl -L http://get.daocloud.io/docker/compose/releases/download/v2.2.3/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-composesudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
查看版本:
docker-compose --version
卸载
rm usr/local/bin/docker-compose
3. 问题排查
出现以下问题:
Executing docker install script, commit: 93bb55b16a5f5c8ce33e0f4784cb8af149d9590f Warning: the “docker” command
appears to already exist on this system.
If you already have Docker installed, this script can cause trouble,
which is why we’re displaying this warning and provide the opportunity
to cancel the installation.
If you installed the current Docker package using this script and are
using it again to update Docker, you can safely ignore this message.
You may press Ctrl+C now to abort this script.
sleep 20原因:从DaoCloud上下载的docker-compose有问题,改为从GitHub上官方源码仓库下载就行了:
curl -SL https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose