准备工作,配置yum源
#cd /etc/yum.repos.d
//备份旧的配置文件:
#mv CentOS-Base.repo CentOS-Base.repo.bak
//下载阿里源的文件
#wget -O CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repo
//清理缓存
#yum clean all
//重新生成缓存
#yum makecache
一、卸载旧版本docker
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
二、下载rpm包到同一个文件夹下
https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/
container.io-1.2.13-3.2.el7.x86_64.rpm
docker-ce-19.03.12-3.el7.x86_64.rpm
docker-ce-cli-19.03.12-3.el7.x86_64.rpm
三、安装docker
yum install *.rpm
systemctl enable docker
systemctl start docker
四、安装docker-compose
yum -y install epel-release
yum -y install python-pip
pip install --upgrade pip
yum -y install python-devel python-subprocess32 && \
find / -name *subpro*.egg-info && \
find / -name *subpro*.egg-info |xargs rm -rf && \
pip install docker-compose && \
docker-compose version
五、完美