1.安装docker最简便的方法,实用阿里云镜像仓库
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
systemctl enable docker
2.默认的/var/lib/docker目录的空间特别小,所以要修改docker文件的默认存储路径
vim /lib/systemd/system/docker.service
在ExecStart 添加 --graph=/home/docker/lib,如下图红色区域所示:
3.重启docker服务
systemctl daemon-reload;
systemctl restart docker;
systemctl enable docker;