可以直接执行下面所有命令,如果有错误中断,可根据下面命令步骤分解进行个人的分析改正。

sudo yum -y install epel-release
sudo yum install python-pip
yum install wget -y
cd /usr/local/bin
wget https://github.com/docker/compose/releases/download/1.14.0-rc2/docker-compose-Linux-x86_64
rename docker-compose-Linux-x86_64 docker-compose docker-compose-Linux-x86_64
chmod +x /usr/local/bin/docker-compose

下面是命令步骤分解:

  1. 安装扩展源和python-pip模块

    sudo yum -y install epel-release
    sudo yum install python-pip
  2. 安装下载工具wget

    yum install wget -y
  3. 下载docker-compose资源

    cd /usr/local/bin
    wget https://github.com/docker/compose/releases/download/1.14.0-rc2/docker-compose-Linux-x86_64
  4. 进行重命名

    rename docker-compose-Linux-x86_64 docker-compose docker-compose-Linux-x86_64
  5. 给予权限

    chmod +x /usr/local/bin/docker-compose
  6. 执行docker-compose version,如有下面类似回显,表示docker-compose安装成功。

    docker-compose version 1.14.0-rc2, build 24dae73
    docker-py version: 2.3.0
    CPython version: 2.7.13
    OpenSSL version: OpenSSL 1.0.1t  3 May 2016

李博帅
15 声望5 粉丝