Centos7.6安装docker和docker-compose

centos7.6安装docker和docker-compose

一、docker 安装

1、升级所有包(这步版本够用不要随便进行,会更新系统内核,可能导致开不了机)

yum update

2、安装依赖包

yum install -y yum-utils device-mapper-persistent-data lvm2

3、添加aliyun docker软件包源

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

4、添加软件包源到本地缓存

yum makecache fast
rpm --import https://mirrors.aliyun.com/docker-ce/linux/centos/gpg

5、安装docker

yum -y install docker-ce

6、设置开机启动docker

systemctl enable docker

7、重启docker

systemctl restart docker

二、docker-compose安装

1、检查linux有没有安装python-pip包

yum install python-pip -y

2、没有python-pip包就执行命令

yum -y install epel-release

3、执行成功之后,再次执行

yum install python-pip

4、对安装好的pip进行升级

pip install --upgrade pip

5、安装docker-compose,安装过程中会遇到一些坑,参考下面异常和解决办法进行处理,然后再尝试执行命令:

pip install docker-compose
异常以及解决办法

异常1:jsonschema 3.2.0 has requirement six>=1.11.0, but you’ll have six1.9.0 which is incompatible

执行命令:

pip install six --user -U
pip install ipython --user -U

异常2:building wheel for subprocess32 (setup.py) 和 running setup.py install for subprocess32 … error

执行命令:

yum install python-devel
yum groupinstall "Development Tools"  
yum install -y gcc g++ kernel-devel

异常3: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 --ignore-installed requests

6、安装成功后,执行命令,查看docker-compose是否安装成功

docker-compose -version
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值