Docker学习笔记3:CentOS7下安装Docker-Compose

时间:2023-01-10 09:28:50

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

安装Docker-Compose之前,请先安装 python-pip,请参考我的另一篇博文CentOS7下安装python-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

Docker学习笔记3:CentOS7下安装Docker-Compose

执行成功之后:docker-compose  --version 查看版本信息.

[root@localhost ~]# docker-compose -version
docker-compose version 1.8.1, build 878cff1

http://blog.csdn.net/yulei_qq/article/details/52984334