1. 安装 rancher
docker pull rancher/server:latest
docker pull rancher/agent:v1.2.11
2. 启动 rancher
docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:latest
加入主机
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.175.147:8080/v1/scripts/D9DC474DE3871DCE2AAE:1546214400000:cuJQNeiZWb18RgfYYx0ShCz1c4E
3. 解决 DNS Checking loopback IP address 127.0.0.0/8, localhost or ::1 configured as the DNS server on the host file /etc/resolv.conf, can't accept
参考 https://blog.csdn.net/qq_37146850/article/details/80089298
(1). sudo vim /etc/docker/daemon.json
(2) . 添加下面字符
{
"dns": ["8.8.8.8", "8.8.4.4", "your ip"]
}
(3)sudo service docker restart