参考博客:https://blog.csdn.net/JyuSun/article/details/77927865#commentBox
以下centos-local.tgz已打包完成,打包过程可参考以上链接可在百度网盘上下载
链接:https://pan.baidu.com/s/1FfLNBLtICEkSljTQgkuu8Q
提取码:j5ad
tar -xvzf centos-local.tgz
cd docker-ce-local
# 安装createrepo
rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm
rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm
rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm
# 将所有的安装源移动到备份文件夹中
cd /etc/yum.repos.d/
mkdir repobak
mv CentOS* repobak/
vi /etc/yum.repos.d/docker-ce-local.repo
-------
[docker-ce-local]
name=Local Yum
baseurl=file:///root/docker-ce-local/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
------------
如果不对,修改
gpgkey=file:///root/docker-ce-local/gpg
~~~~~~~~~~~~~~~~~~~~~~~~
# 生成源索引及缓存
createrepo /root/docker-ce-local
yum makecache
# 安装docker-ce
yum install docker-ce
docker version
(1)记得修改你存放docker-ce-local的目录,修改以上地