卸载已有的避免冲突
yum remove docker docker-common docker-selinux docker-engine
安装需要的软件包,yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的
yum install -y yum-utils device-mapper-persistent-data lvm2
设置yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装最新的docker-ce,社区版
yum install -y docker-ce
启动并设置开启启动
systemctl start docker
systemctl enable docker
安装rancher容器
docker run -d --restart=unless-stopped -p 8080:8080 rancher/server
访问Rancher管理平台
http://192.168.56.105:8080
sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.11 http://192.168.56.105:8080/v1/scripts/1D4C89E1970515788B57:1546214400000:PO0FOARQvB0unouJG6Bd1InItUQ
重启
systemctl restart docker
针对Docker客户端版本大于 1.10.0 的用户
您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://tnxkcso1.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.11 http://192.168.56.105:8080/v1/scripts/1D4C89E1970515788B57:1546214400000:PO0FOARQvB0unouJG6Bd1InItUQ
引用
Rancher及Docker快速上手指南(一)
https://www.jianshu.com/p/aa5eefed29b4
全栈化容器管理平台
https://www2.cnrancher.com/