1、安装yum工具
yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 --skip-broken
2、 设置docker镜像源
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's/download.docker.com/mirrors.aliyun.com\/docker-ce/g' /etc/yum.repos.d/docker-ce.repo
yum makecache fast
3、关闭防火墙
# 关闭 systemctl stop firewalld # 禁止开机启动防火墙 systemctl disable firewalld #查看是否关闭防火墙 systemctl status firewalld
4、启动docker
systemctl start docker # 启动docker服务 systemctl stop docker # 停止docker服务 systemctl restart docker # 重启docker服务
5、查看docker是否启动正常
systemctl status docker