首发于博客园:https://www.cnblogs.com/niceyoo/p/13096181.html

1、安装仓库所需要的软件包

yum install -y yum-utils device-mapper-persistent-data lvm2

2、设置yum加速源

yum-config-manager --add-repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、安装docker-ce

yum install docker-ce docker-ce-cli containerd.io

4、启动docker

systemctl start docker

5、查看docker启动状态

systemctl status docker

image-20200611150227240

6、相应的其他指令

# 关闭docker
systemctl stop docker

# 开机启动docker
systemctl enable docker