解决CentOS 8出现的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

PS: 其中的/usr/local/soft/docker-compose为自己想要安装的docker-compose的路径,可自行修改

2、给Docker-Compose赋予权限

chmod +x /usr/local/soft/docker-compose

PS: 目录与上述一致

3、安装Docker-Compose插件

yum -y install epel-release
yum install python3-pip

PS: CentOS 8只有Python3,不可安装python-pip

pip3 install --upgrade pip
pip3 install docker-compose

PS: CentOS 8只有pip3

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

你可能感兴趣的:(docker)