Centos7离线安装Docker环境

1、安装介质准备

(1)操作系统

Centos7镜像: ftp://ftp.xxx.com/software/ISO/CentOS-7-x86_64-DVD-1810.iso

(2)Docker安装包

依赖包: ftp://ftp.xxx.com/software/ISO/docker-ce-17.03.1.ce-1.el7.centos.x86_64.rpm

ftp://ftp.xxx.com/software/ISO/docker-ce-selinux-17.03.1.ce-1.el7.centos.noarch.rpm

ftp://ftp.xxx.com/software/ISO/libtool-ltdl-devel-2.4.2-22.el7_3.i686.rpm

2、本地离线yum源配置

将Centos7的iso镜像包上传到服务器,挂载镜像,制作yum源

#创建centos7本地挂载目录

mkdir -p /media/centos7/

mount ./CentOS-7-x86_64-DVD-1611.iso /media/centos7/

#内网网络环境清空仓库信息

rm -rf /etc/yum.repos.d/*.repo

vim /etc/yum.repos.d/centos7-localsource.repo

#########添加以下信息############

[centos7-localsource]

name=centos7

baseurl=file:///media/centos7

enabled=1

gpgcheck=0

###############################

#刷新yum安装缓存

yum clean all

yum makecache

3、执行Docker服务安装

(1)执行yum安装相关的依赖

yum -y install systemd-devel systemd-libs libseccomp device-mapper-libs

(2)离线安装软件包,按照以下顺序安装

yum install -y libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm

yum install -y docker-ce-selinux-17.03.1.ce-1.el7.centos.noarch.rpm

yum install -y docker-ce-17.03.1.ce-1.el7.centos.x86_64.rpm

(3)设置docker为开机启动并且启动docker服务

systemctl enable docker.service

systemctl start docker.service

点赞

发表回复