uname -r
1
yum update
1
yum install -y yum-utils device-mapper-persistent-data lvm2
1
# 获取镜像源
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
1
2
2
yum list docker-ce --showduplicates | sort -r
1
yum install docker-ce
yum install <FQPN> # 例如:sudo yum install docker-ce-17.12.0.ce
1
2
2
systemctl start docker
systemctl enable docker
docker version
1
2
3
2
3
# 设置镜像加速器
touch /etc/docker/daemon.json
cat > /etc/docker/daemon.json <<-'EOF'
{
"exec-opts": ["native.cgroupdriver=systemd"],
"registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com"]
}
EOF
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8