解决CentOS 7出现docker-compose: command not found
解决CentOS 7出现docker-compose: command not found
1. 安装docker-compose
既然使用了docker-compose那自然得安装了
在GitHub上拉取过慢,建议在国内源DaoCloud中拉取:
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/soft/docker-compose
其中的/usr/local/soft/docker-compose为自己想要安装的docker-compose的路径,可自行修改
2. 给Docker-Compose赋予权限
chmod +x /usr/local/soft/docker-compose
目录与上述一致
3. 安装Docker-Compose插件
yum -y install epel-release
yum install python3-pip
pip3 install --upgrade pip
pip3 install docker-compose
4. 修改指向
凡是在之前修改了安装地址都需要修改指向
ln -sf /usr/local/soft/docker-compose /usr/local/bin/docker-compose
让/usr/local/soft/docker-compose 指向 /usr/local/bin/docker-compose,以避免出现以下问题:
-bash: /usr/local/bin/docker-compose: No such file or directory
5. 确认版本
docker-compose --version