Docker-Compose安装—CentOS7

2019-03-12  本文已影响0人  G_YDG

安装Docker-Compose之前,需要先安装 python-pip

python-pip安装

检查是否已安装python-pip包

[root@localhost]# pip -V

python-pip 安装

[root@localhost]# yum -y install epel-release

[root@localhost]# yum install python-pip

升级安装好的pip 

[root@localhost]# pip install --upgrade pip

安装完成检查pip环境

[root@localhost]# pip -V

安装完成后,进行Docker-Compose的安装

[root@localhost]# pip install docker-compose

安装完成,检查docker-compose:

[root@localhost]# docker-compose -version

安装Docker-Compose时,可能会出现的错误以及解决方法:

1.若报错:ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out

解决方法:pip --default-timeout=200 install -U docker-compose

2.若报错:Cannot uninstall ‘requests’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决办法:pip install docker-compose --ignore-installed requests

3.若报错:pkg_resources.DistributionNotFound: backports.ssl-match-hostname>=3.5

解决办法:

更新backports.ssl-match-hostname的版本

在终端输入命令 pip install --upgrade backports.ssl_match_hostname

如若python版本过低,需升级,见:http://www.cnblogs.com/YatHo/p/8257387.html

本人在学习安装Docker-Compose时,原参考于文章https://www.cnblogs.com/YatHo/p/7815400.html

上一篇下一篇

猜你喜欢

热点阅读