Centos7如何搭建docker
Centos7如何搭建docker
Centos如何搭建docker?本教程以Centos7位系统为例
本配置适用于centos7版本
1.首先进入CentOS系统,检查CentOS系统的内核版本,要求系统内核版本高于3.10,使用uname -r命令

2.使用root权限登录CentOS,如果使用非root用户,则需要切换到root用户,确保yum包更新到最新,操作如图

3.如果之前有安装过Docker,则需要将旧版本删除,没有则可跳过这一步
yum remove docker docker-common docker-selinux docker-engine
4.安装需要的软件包,yum-util提供yum-config-manager功能,另一个是devicemapper驱动依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
5.设置yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

6.安装最新版本的Docker
yum install docker-ce docker-ce-cli containerd.io -y

7.启动Docker并设置开机启动
systemctl start docker
systemctl enable docker

8.验证Docker是否安装成功,出现如下内容,则说明安装成功
docker version
