CentOS7下安装Docker-Compose
Docker-Compose是一个部署多个容器的简单但是非常必要的工具.
安装Docker-Compose之前,请先安装 python-pip
安装 python-pip
1、首先检查linux有没有安装python-pip包,终端执行 pip -V
[root@vm-50-151 network-scripts]# pip -V
-bash: pip: command not found
2、没有python-pip包就执行命令 yum -y install epel-release
[root@vm-50-151 network-scripts]# yum -y install epel-release
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/2): extras/7/x86_64/primary_db | 129 kB 00:00:05
(2/2): updates/7/x86_64/primary_db | 3.6 MB 00:00:09
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.163.com
* updates: mirrors.cn99.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution Dependencies Resolved =======================================================================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================================================================
Installing:
epel-release noarch 7-9 extras 14 k Transaction Summary
=======================================================================================================================================================================================================================
Install 1 Package Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm | 14 kB 00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-9.noarch 1/1
Verifying : epel-release-7-9.noarch 1/1 Installed:
epel-release.noarch 0:7-9 Complete!
3、执行成功之后,再次执行yum -y install python-pip
[root@vm-50-151 network-scripts]# yum install python-pip
Loaded plugins: fastestmirror, langpacks
epel/x86_64/metalink | 7.3 kB 00:00:00
epel | 4.7 kB 00:00:00
(1/3): epel/x86_64/group_gz | 261 kB 00:00:01
epel/x86_64/updateinfo FAILED 54% [=============================================- ] 165 kB/s | 3.9 MB 00:00:20 ETA
http://ftp.riken.jp/Linux/fedora/epel/7/x86_64/repodata/ed160c344c46b2ec8d800367326ceaf25560b1515a0603a1e33a795b8b6492a1-updateinfo.xml.bz2: [Errno 12] Timeout on http://ftp.riken.jp/Linux/fedora/epel/7/x86_64/repodata/ed160c344c46b2ec8d800367326ceaf25560b1515a0603a1e33a795b8b6492a1-updateinfo.xml.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
(2/3): epel/x86_64/updateinfo | 845 kB 00:00:10
(3/3): epel/x86_64/primary_db | 6.1 MB 00:01:05
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.163.com
* updates: mirrors.cn99.com
Resolving Dependencies
--> Running transaction check
---> Package python2-pip.noarch 0:8.1.2-5.el7 will be installed
--> Processing Dependency: python-setuptools for package: python2-pip-8.1.2-5.el7.noarch
--> Running transaction check
---> Package python-setuptools.noarch 0:0.9.8-7.el7 will be installed
--> Processing Dependency: python-backports-ssl_match_hostname for package: python-setuptools-0.9.8-7.el7.noarch
--> Running transaction check
---> Package python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7 will be installed
--> Processing Dependency: python-backports for package: python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch
--> Running transaction check
---> Package python-backports.x86_64 0:1.0-8.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved =======================================================================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================================================================
Installing:
python2-pip noarch 8.1.2-5.el7 epel 1.7 M
Installing for dependencies:
python-backports x86_64 1.0-8.el7 base 5.8 k
python-backports-ssl_match_hostname noarch 3.4.0.2-4.el7 base 12 k
python-setuptools noarch 0.9.8-7.el7 base 397 k Transaction Summary
=======================================================================================================================================================================================================================
Install 1 Package (+3 Dependent packages) Total download size: 2.1 M
Installed size: 9.1 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/python2-pip-8.1.2-5.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY===========- ] 0.0 B/s | 1.3 MB --:--:-- ETA
Public key for python2-pip-8.1.2-5.el7.noarch.rpm is not installed
(1/4): python2-pip-8.1.2-5.el7.noarch.rpm | 1.7 MB 00:00:00
(2/4): python-backports-1.0-8.el7.x86_64.rpm | 5.8 kB 00:00:05
(3/4): python-setuptools-0.9.8-7.el7.noarch.rpm | 397 kB 00:00:05
(4/4): python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch.rpm | 12 kB 00:00:06
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 302 kB/s | 2.1 MB 00:00:07
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-9.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-backports-1.0-8.el7.x86_64 1/4
Installing : python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch 2/4
Installing : python-setuptools-0.9.8-7.el7.noarch 3/4
Installing : python2-pip-8.1.2-5.el7.noarch 4/4
Verifying : python2-pip-8.1.2-5.el7.noarch 1/4
Verifying : python-setuptools-0.9.8-7.el7.noarch 2/4
Verifying : python-backports-1.0-8.el7.x86_64 3/4
Verifying : python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch 4/4 Installed:
python2-pip.noarch 0:8.1.2-5.el7 Dependency Installed:
python-backports.x86_64 0:1.0-8.el7 python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7 python-setuptools.noarch 0:0.9.8-7.el7 Complete!
4、对安装好的pip进行升级 pip install --upgrade pip
[root@vm-50-151 network-scripts]# pip install --upgrade pip
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 1.3MB 135kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Successfully installed pip-9.0.1
至此,pip安装好了,执行pip -V 再次检查pip环境。
[root@vm-50-151 network-scripts]# pip -V
pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)
安装Docker-Compose
1.终端执行:pip install docker-compose
报错:ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out
解决:pip --default-timeout=200 install -U docker-compose
[root@vm-50-151 network-scripts]# pip --default-timeout=200 install -U docker-compose
Collecting docker-compose
Using cached docker_compose-1.17.1-py2.py3-none-any.whl
Collecting websocket-client<1.0,>=0.32.0 (from docker-compose)
Using cached websocket_client-0.44.0-py2.py3-none-any.whl
Collecting requests!=2.11.0,<2.12,>=2.6.1 (from docker-compose)
Downloading requests-2.11.1-py2.py3-none-any.whl (514kB)
100% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 522kB 832kB/s
Collecting PyYAML<4,>=3.10 (from docker-compose)
Downloading PyYAML-3.12.tar.gz (253kB)
100% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 256kB 1.7MB/s
Collecting dockerpty<0.5,>=0.4.1 (from docker-compose)
Downloading dockerpty-0.4.1.tar.gz
Collecting ipaddress>=1.0.16; python_version < "3.3" (from docker-compose)
Downloading ipaddress-1.0.18-py2-none-any.whl
Collecting docopt<0.7,>=0.6.1 (from docker-compose)
Downloading docopt-0.6.2.tar.gz
Collecting backports.ssl-match-hostname>=3.5; python_version < "3.5" (from docker-compose)
Downloading backports.ssl_match_hostname-3.5.0.1.tar.gz
Collecting enum34<2,>=1.0.4; python_version < "3.4" (from docker-compose)
Downloading enum34-1.1.6-py2-none-any.whl
Collecting texttable<0.10,>=0.9.0 (from docker-compose)
Downloading texttable-0.9.1.tar.gz
Collecting cached-property<2,>=1.2.0 (from docker-compose)
Downloading cached_property-1.3.1-py2.py3-none-any.whl
Collecting docker<3.0,>=2.5.1 (from docker-compose)
Downloading docker-2.6.1-py2.py3-none-any.whl (117kB)
100% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 122kB 2.8MB/s
Collecting jsonschema<3,>=2.5.1 (from docker-compose)
Downloading jsonschema-2.6.0-py2.py3-none-any.whl
Collecting six<2,>=1.3.0 (from docker-compose)
Downloading six-1.11.0-py2.py3-none-any.whl
Collecting docker-pycreds>=0.2.1 (from docker<3.0,>=2.5.1->docker-compose)
Downloading docker_pycreds-0.2.1-py2.py3-none-any.whl
Collecting functools32; python_version == "2.7" (from jsonschema<3,>=2.5.1->docker-compose)
Downloading functools32-3.2.3-2.zip
Installing collected packages: six, websocket-client, requests, PyYAML, dockerpty, ipaddress, docopt, backports.ssl-match-hostname, enum34, texttable, cached-property, docker-pycreds, docker, functools32, jsonschema, docker-compose
Found existing installation: six 1.9.0
Uninstalling six-1.9.0:
Successfully uninstalled six-1.9.0
Running setup.py install for PyYAML ... done
Running setup.py install for dockerpty ... done
Running setup.py install for docopt ... done
Found existing installation: backports.ssl-match-hostname 3.4.0.2
Uninstalling backports.ssl-match-hostname-3.4.0.2:
Successfully uninstalled backports.ssl-match-hostname-3.4.0.2
Running setup.py install for backports.ssl-match-hostname ... done
Running setup.py install for texttable ... done
Running setup.py install for functools32 ... done
Successfully installed PyYAML-3.12 backports.ssl-match-hostname-3.5.0.1 cached-property-1.3.1 docker-2.6.1 docker-compose-1.17.1 docker-pycreds-0.2.1 dockerpty-0.4.1 docopt-0.6.2 enum34-1.1.6 functools32-3.2.3.post2 ipaddress-1.0.18 jsonschema-2.6.0 requests-2.11.1 six-1.11.0 texttable-0.9.1 websocket-client-0.44.0
检查docker-compose 安装:docker-compose -version
[root@vm-50-151 network-scripts]# docker-compose -version
docker-compose version 1.17.1, build 6d101fb
如果报错:
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
CentOS7下安装Docker-Compose的更多相关文章
- docker(一) Centos7下安装docker
docker(一) Centos7下安装dockerdocker(二) windows10下安装dockerdocker(三) 镜像和容器常用命令 docker(四) 使用Dockerfile构建镜像 ...
- CentOS7下安装docker(Docker系列1)
CentOS7下安装docker 系统要求 为了安装docker,需要准备 64-bit的CentOS 7 删除非官方的Docker包 yum的仓库中有一个很旧的Docker包, 现在Docker官方 ...
- centos7下安装docker与镜像加速
1.背景 centos7下安装docker 2.安装 第一步:检查是否为centos7版本 第二步:依赖环境安装 执行如下两个命令: yum -y install gcc yum -y install ...
- centos7 下安装docker报错:You could try using...
搞了台VPS,想要装docker,发现死活装不上,各种报错.之前系统是centos6,发现官方现在已经不支持centos6了,遂升级到centos7,然后还是出现下面这个错误. Error: Pack ...
- Linux(centos7)下安装Docker
近期公司开始推Docker技术.这个系列的文章都是基于CentOS7系统下进行讲解的. Docker简介 Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器 ...
- centos7下安装docker(21docker swarm集群创建)
创建swarm集群: 实验环境:盗图 swarm-manager是manager node,swarm-worker1和swarm-worker2是worker node. 所有节点的docker版本 ...
- centos7下安装docker(14安装docker machine)
之前我们做的实验都是在一个host上面的,其实在真正的环境中有多个host,容器在这些host上面启动,运行,停止和销毁,相关容器会通过网络相互通信,无论他们是否运行在相同的host上面. 对于这种歌 ...
- Centos7下安装Docker(详细的新手装逼教程)
早就听说过Docker,一直不清楚是个啥,今天捣鼓了一下,这里做个记录. --------------------------------------------------------------- ...
- Centos7下安装Docker[z]
[z]https://www.cnblogs.com/qgc1995/p/9553572.html https://yq.aliyun.com/articles/691610?spm=a2c4e.11 ...
- Centos7下安装docker(1)
1.确认系统没安装任何docker相关的安装包 yum remove docker docker-common docker-selinux docker-engine centos7的docker存 ...
随机推荐
- 通过Graph 浏览器体验Microsoft Graph
作者:陈希章 发表于 2017年3月18日 上一篇介绍了Microsoft Graph的基本概念,接下来我们快速体验一下Microsoft Graph到底能做什么? 为了帮助开发人员直观和快速体验Mi ...
- 如何连接别人电脑上的Oracle数据库--duende99
需要一些前提条件: 1.对方的主机能被连接(如在同一局域网内) 2.需要知道对方数据库IP.端口号.服务名 3.需要知道对方提供的管理数据库的用户名及密码 连接方法: 1.在本地的oracle安装目录 ...
- SQL 杂活
例子一:查询两个表数据并且分页展示 select * from ( select ROW_NUMBER() OVER(order by CreateTime desc) as rownum,* fro ...
- Swift3.0 UITextField
import UIKit private var textfieldd = UITextField() class TextFieldViewController: UIViewController, ...
- ios 中的循环引用问题及解决
循环引用,指的是多个对象相互引用时,使得引用形成一个环形,导致外部无法真正是否掉这块环形内存.其实有点类似死锁. 举个例子:A->B->C->....->X->B - ...
- JDK源码阅读(1)_简介+ java.io
1.简介 针对这一个版块,主要做一个java8的源码阅读笔记.会对一些在javaWeb中应用比较广泛的java包进行精读,附上注释.对于容易混淆的知识点给出相应的对比分析. 精读的源码顺序主要如下: ...
- [置顶]
xamarin Tablayout+Viewpager+Fragment顶部导航栏
最近几天不忙,所以把项目中的顶部导航栏的实现归集一下.android中使用TabLayout+ViewPager+Fragment制作顶部导航非常常见,代码实现也比较简单.当然我这个导航栏是基于xam ...
- 关于git的一些理论知识
一.什么是版本控制器 好多刚用git的coder一说起git,就随口会说出版本控制器嘛,我问那是干嘛的,大部分人就回答上传代码的.然后会用,但是有些理论你问他们他们就不知道了,比如不是代码的文件就不能 ...
- JDK8.0新特性
连接转载地址:http://www.2cto.com/kf/201609/544044.html Eclipse: http://aiyiupload.oss-cn-beijing.aliyuncs. ...
- Linq To EF
l简单查询:var result = from c in Entities.Customer select c; l条件查询: 普通linq写法: var result = from c in Ent ...