Docker-Compose是一个部署多个容器的简单但是非常必要的工具.

安装Docker-Compose之前,请先安装 python-pip

安装 python-pip

1、首先检查linux有没有安装python-pip包,终端执行 pip -V

[root@vm-50-151 network-scripts]# pip -V
-bash: pip: command not found

2、没有python-pip包就执行命令 yum -y install epel-release

[root@vm-50-151 network-scripts]# yum -y install epel-release
 ······
 Complete!

3、执行成功之后,再次执行yum -y install python-pip

[root@vm-50-151 network-scripts]# yum install python-pip
······
Complete!

4、对安装好的pip进行升级 pip install --upgrade pip

[root@vm-50-151 network-scripts]# pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 351kB/s 
Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-18.0
至此,pip安装好了,执行pip -V 再次检查pip环境。
[root@vm-50-151 network-scripts]# pip -V
pip 18.0 from /usr/lib/python2.7/site-packages/pip (python 2.7)

安装Docker-Compose

[root@vm-50-151 network-scripts]# pip install docker-compose
    ······

检查docker-compose 安装:docker-compose -version

[root@vm-50-151 network-scripts]# docker-compose -version
docker-compose version 1.22.0, build f46880f