docker-compose安装
安装python-pip
yum -y install epel-release
yum -y install python-pip
pip install docker-compose
出现
You are using pip version 8.1.2, however version 18.0 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.
需要
pip install –upgrade pip
再
pip install docker-compose
测试
docker-compose version
出现
ImportError: No module named urllib.parse
根据查证
urlparse模块在Python 3中重命名为urllib.parse
所以模块在Python 2.7下你应该使用urlparse
系统自带Python2.7卸载重装了,还是不行。
方式二安装
curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-uname -s
-uname -m
-o /usr/local/bin/docker-compose
报错
fatal: unable to access ‘https://github.com/rancher/rancher.git/‘:Peer reports incompatible or unsupported protocol version.
解决方法
yum update -y nss curl libcurl
继续安装
然后可执行权限
chmod +x /usr/local/bin/docker-compose
测试安装
输出
docker-compose version 1.22.0, build f46880f
安装完成。