Press "Enter" to skip to content

CentOS7下安装Docker-Compose操作记录

Docker-Compose是一个部署多个容器的简单但是非常必要的工具.安装Docker-Compose之前,请先安装 python-pip

一、安装 python-pip

[root@workbench-test ~]# pip -V
-bash: pip: command not found

[root@workbench-test ~]# yum install python-pip
[root@workbench-test ~]# yum -y install epel-release
[root@workbench-test ~]# yum install python-pip
[root@workbench-test ~]# pip install --upgrade pip

[root@workbench-test ~]# pip -V
pip 10.0.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)

二、安装Docker Compose

[root@workbench-test ~]# pip install docker-compose
---------------------------------------------------------------------------------------
如果报错:
ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out
解决:
# pip --default-timeout=200 install -U docker-compose
--------------------------------------------------------------------------------------
如果执行中报错:
Setup script exited with error: command 'gcc' failed with exit status 1异常

这是没有正确安装Python开发环境导致,解决如下:
# yum install python-devel
# yum install libevent-devel
# pip install gevent
# yum install groupinstall 'development tools'
--------------------------------------------------------------------------------------

检验docker-compose是否安装成功
[root@workbench-test ~]# docker-compose --version
docker-compose version 1.21.2, build a133471
--------------------------------------------------------------------------------------
如果报错:
pkg_resources.DistributionNotFound: backports.ssl-match-hostname>=3.5
解决方法:更新backports.ssl-match-hostname的版本,在终端输入命令
# pip install --upgrade backports.ssl_match_hostname

注:本文转自https://www.cnblogs.com/kevingrace/p/9088877.html

Be First to Comment

发表评论

电子邮件地址不会被公开。 必填项已用*标注