安装所需的包:
yum install -y yum-utils device-mapper-persistent-data lvm2
安装docker的repo:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装docker ce:
yum install docker-ce
启动docker:
systemctl start docker
验证docker:
docker run hello-world
配置docker国内镜像:
编辑/etc/docker/daemon.json,添加以下一行
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
重新启动docker:
systemctl restart docker
如要安装指定的旧版本则需要使用rpm安装,比如安装17.03.2.ce版本
yum remove -y docker-ce container-selinux rm -rf /var/lib/docker curl -O https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm curl -O https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm rpm -Uvh docker-ce*17.03.2.ce*.rpm
Pingback引用通告: 使用kubeadm部署高可用Kubernetes v1.11.1集群 | eBanBan Studio