一、先在dashboard上创建机器
然后点击创建实例
二、登录机器
1.引入库
[root@host-192-168-0-65 ~]# ssh root@192.168.0.65
The authenticity of host '192.168.0.65 (192.168.0.65)' can't be established.
ECDSA key fingerprint is SHA256:UCKaEWbMMQu9j9fr7NsnZpjh0j2+KZvEVcqjTKdwLdE.
ECDSA key fingerprint is MD5:98:08:24:9d:dd:c7:5e:ac:d1:31:66:59:e8:b0:b2:68.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.65' (ECDSA) to the list of known hosts.
root@192.168.0.65's password:
[root@host-192-168-0-65 ~]# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
然后系统开启docker
[root@host-192-168-0-65 ~]# systemctl start docker
然后查看docker信息
[root@host-192-168-0-65 ~]# docker info
然后根据docker搭建rancher
[root@host-192-168-0-65 ~]# docker run --privileged -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
Unable to find image 'rancher/rancher:latest' locally
latest: Pulling from rancher/rancher
af637d9f9908: Pull complete
f9224574abce: Pull complete
ebae3352c76e: Pull complete
7b21d0842057: Pull complete
88a4b8d1c9ea: Pull complete
068e40008a4a: Pull complete
af8d478ed359: Pull complete
0570bed5c15a: Pull complete
f7dfd304c929: Pull complete
e0f5d341d113: Pull complete
bd89a58c597d: Pull complete
c03c718eef46: Pull complete
5e1f456cdbf8: Pull complete
e55dca76e75f: Pull complete
c9a821480bc3: Pull complete
c6e3491b680d: Pull complete
9d7c10a11f0f: Pull complete
Digest: sha256:51658639bf2b28f4796e7daa04b0434e29fcf69ce062bf649462be77ae76cd2c
Status: Downloaded newer image for rancher/rancher:latest
6e7e263ca77c297bc598656b5eb60545b4f7b0182060d72efb1a21ce11760d08