CentOS7离线部署docker
这篇文章主要介绍"CentOS7离线部署docker",在日常操作中,相信很多人在CentOS7离线部署docker问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"CentOS7离线部署docker"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
1、环境准备
系统环境为: CentOS Linux release 7.5.1804 (Core)
安装docker版本为: 17.12.0-ce
2、准备部署文件
在http://mirrors.163.com/centos/7/os/x86_64/Packages/中下载如下rpm安装包:
audit-2.8.4-4.el7.x86_64.rpmaudit-libs-2.8.4-4.el7.x86_64.rpmlibselinux-2.5-14.1.el7.x86_64.rpmlibselinux-python-2.5-14.1.el7.x86_64.rpmlibselinux-utils-2.5-14.1.el7.x86_64.rpmlibsemanage-2.5-14.el7.x86_64.rpmlibsepol-2.5-10.el7.x86_64.rpmpolicycoreutils-2.5-29.el7.x86_64.rpmaudit-libs-python-2.8.4-4.el7.x86_64.rpmcheckpolicy-2.5-8.el7.x86_64.rpmlibcgroup-0.41-20.el7.x86_64.rpmlibsemanage-python-2.5-14.el7.x86_64.rpmlibtool-ltdl-2.4.2-22.el7_3.x86_64.rpmpolicycoreutils-python-2.5-29.el7.x86_64.rpmpython-IPy-0.75-6.el7.noarch.rpmsetools-libs-3.3.8-4.el7.x86_64.rpm
在https://download.docker.com/linux/centos/7/x86_64/stable/Packages/中下载docker的安装包:
docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
在http://rpm.pbone.net/index.php3/stat/4/idpl/36266349/dir/scientific_linux_7/com/container-selinux-2.9-4.el7.noarch.rpm.html中下载container-selinux安装包:
container-selinux-2.9-4.el7.noarch.rpm
经测试本系统中有些rpm安装包是需要update,有些是要install,为此将上述的rpm包分成update_rpm和install_rpm,其中: update_rpm中的rpm有:
audit-2.8.4-4.el7.x86_64.rpmaudit-libs-2.8.4-4.el7.x86_64.rpmlibselinux-2.5-14.1.el7.x86_64.rpmlibselinux-python-2.5-14.1.el7.x86_64.rpmlibselinux-utils-2.5-14.1.el7.x86_64.rpmlibsemanage-2.5-14.el7.x86_64.rpmlibsepol-2.5-10.el7.x86_64.rpmpolicycoreutils-2.5-29.el7.x86_64.rpm
install_rpm中的rpm有:
audit-libs-python-2.8.4-4.el7.x86_64.rpmcheckpolicy-2.5-8.el7.x86_64.rpmcontainer-selinux-2.9-4.el7.noarch.rpmdocker-ce-17.12.0.ce-1.el7.centos.x86_64.rpmlibcgroup-0.41-20.el7.x86_64.rpmlibsemanage-python-2.5-14.el7.x86_64.rpmlibtool-ltdl-2.4.2-22.el7_3.x86_64.rpmpolicycoreutils-python-2.5-29.el7.x86_64.rpmpython-IPy-0.75-6.el7.noarch.rpmsetools-libs-3.3.8-4.el7.x86_64.rpm
3、安装docker
首先更新需要更新rpm,即执行如下命令:
rpm -Uvh update_rpm/*.rpm
安装需要安装的rpm,即执行如下命令:
rpm -ivh install_rpm/*.rpm
启动docker:
systemctl start docker
设置docker开机自启动:
systemctl enable docker
验证是否安装成功,直接输入如下命令:
docker version
如果出现下面页面,则表示安装成功了!
到此,关于"CentOS7离线部署docker"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!