yum install -y yum-utils device-mapper-persistent-data lvm2
yum config-manager --add-repo=https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y containerd.io yum install -y docker-ce-3:18.09.1-3.el7
docker version
systemctl start docker
systemctl enable docker
鏡像文件通常都很大,若是以爲鏡像下載比較慢可配置鏡像加速器。linux
阿里雲鏡像加速器獲取地址: https://cr.console.aliyun.com/cn-hangzhou/instances/mirrorsdocker
個人鏡像加速地址也可直接使用 https://g6jp4cfd.mirror.aliyuncs.comjson
sudo mkdir -p /etc/docker vi /etc/docker/daemon.json # 添加 { "registry-mirrors": ["https://g6jp4cfd.mirror.aliyuncs.com"] } # 重啓 sudo systemctl daemon-reload sudo systemctl restart docker