close

抓 IOS ...
用這 IOS 開機 ..

進去後 sudo ...成 root ...改 rancher 這 user 密碼 ...
--> sudo passwd rancher

用另一台 ssh 進去這 OS (用帳號 rancher )
寫 cloud-config.xml 

#cloud-config

hostname: rancheros

rancher:
    network:
     interfaces:
      eth*:
       dhcp: false
      eth0:
       address: 192.168.0.77/24
       gateway: 192.168.0.1
      dns:
       nameservers:
         - 8.8.8.8
         - 168.95.1.1

執行 suro ros install -c cloud-config.xml  -d /dev/sda

執行完後將 hdd mount 上來

--> sudo mkdir /a
--> sudo mount /dev/sda1 /a

執行完後將 ssh key 放上去 
將 authorized_keys (就是 putty 的 ppk ) 放到  /a/home/rancher/,ssh
找台可 scp 的 ....(windows 用winscp)
-->  scp authorized_keys rancher@192.168.0.77:/a/home/rancher/authorized_keys

再到 rancherOS
--> mkdir /a/home/rancher/.ssh
--> mv /a/home/rancher/authorized_keys /a/home/rancher/.ssh/authorized_keys
--> chown -R rancher:rancher /a/home/rancher
--> chmod 700 /a/home/rancher/.ssh
--> chmod 600 /a/home/rancher/.ssh/authorized_keys
--> sudo umount /a

重開機  ....
用 ssh key 登入那 hdd 的 OS

[rancher@rancher ~]$ ls -la .ssh/authorized_keys
-rw-------    1 rancher  rancher        396 Mar 24 07:53 .ssh/authorized_keys
[rancher@rancher ~]$


那 git 要如何用 .....哈 .....XD

alias git="docker run -ti --rm -v $(pwd):/git bwits/docker-git-alpine"

這樣就好了 ....XD

裝 rancher/server
docker run -d --restart=always -p 8080:8080 rancher/server


開啟先選 local

 

單機上線 : 看第五項的那個 ...複製貼到 linux cmd 中 ....

看到上線機器了 ....

arrow
arrow
    全站熱搜

    echochio 發表在 痞客邦 留言(0) 人氣()