docker-compose是部署多個容器的重要工具。python
一、首先檢查linux有沒有安裝python-pip包,直接執行 yum install python-pip -y;linux
二、沒有python-pip包就執行命令 yum -y install epel-release;docker
三、執行成功以後,再次執行yum install python-pip;python2.7
四、對安裝好的pip進行升級 pip install --upgrade pip;工具
至此,pip工具就安裝好了,下面使用pip 安裝docker-composeui
五、pip install docker-compose;.net
輸入docker-compose驗證,報錯的話就百度,下面這個報錯是百度的:ip
- [root@localhost ~]# docker-compose
- Traceback (most recent call last):
- File "/usr/bin/docker-compose", line 5, in <module>
- from pkg_resources import load_entry_point
- File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, in <module>
- parse_requirements(__requires__), Environment()
- File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 626, in resolve
- raise DistributionNotFound(req)
- pkg_resources.DistributionNotFound: backports.ssl-match-hostname>=3.5
解決:ssl
pip install --upgrade backports.ssl_match_hostnamerem