天天看點

CentOS7下安裝Docker-Compose

CentOS7下安裝Docker-Compose

2、沒有python-pip包就執行指令 yum -y install epel-release

CentOS7下安裝Docker-Compose

(3)、執行成功之後,再次執行yum install python-pip

CentOS7下安裝Docker-Compose
CentOS7下安裝Docker-Compose

(4)、對安裝好的pip進行更新 pip install --upgrade pip

CentOS7下安裝Docker-Compose

至此,pip工具就安裝好了。

安裝好pip之後,就可以安裝Docker-Compose了.

在linunx終端執行:pip install docker-compose.

執行完之後,輸入docker-compse,報如下錯誤:

[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  

解決方法:在終端輸入指令

pip install --upgrade backports.ssl_match_hostname

CentOS7下安裝Docker-Compose

執行成功之後:docker-compose  --version 檢視版本資訊.

[root@localhost ~]# docker-compose -version  

docker-compose version 1.8.1, build 878cff1  

本文轉自gaofeng36599 51CTO部落格,原文連結:http://blog.51cto.com/786678398/1933869