离线部署docker-ce
下载包
删除或者备份原来的所有的yum源文件。
然后添加阿里的yum源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
更新:
清除缓存:yum clean all
生成缓存:yum makecache
更新软件(可选):yum update
下载包:
[root@localhost ~]# yumdownloader --destdir=./docker-ce --resolve docker-ce^C [root@localhost ~]# cd docker-ce/ [root@localhost docker-ce]# ls audit-libs-python-2.8.5-4.el7.x86_64.rpm fuse3-libs-3.6.1-4.el7.x86_64.rpm checkpolicy-2.5-8.el7.x86_64.rpm fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm containerd.io-1.6.28-3.1.el7.x86_64.rpm libcgroup-0.41-21.el7.x86_64.rpm container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm libsemanage-python-2.5-14.el7.x86_64.rpm docker-buildx-plugin-0.12.1-1.el7.x86_64.rpm policycoreutils-2.5-34.el7.x86_64.rpm docker-ce-25.0.3-1.el7.x86_64.rpm policycoreutils-python-2.5-34.el7.x86_64.rpm docker-ce-cli-25.0.3-1.el7.x86_64.rpm python-IPy-0.75-6.el7.noarch.rpm docker-ce-rootless-extras-25.0.3-1.el7.x86_64.rpm setools-libs-3.3.8-4.el7.x86_64.rpm docker-compose-plugin-2.24.6-1.el7.x86_64.rpm slirp4netns-0.4.3-4.el7_8.x86_64.rpm [root@localhost docker-ce]#
本地安装
yum localinstall *.rpm -y