問題描述:
容器化,越來越重要。在雲服務中很大比例的服務都跑在容器中,今天介紹rancheros基於容器的os.
特點:
- 啟動快,比較小系統服務也是基於容器化
- 使用最新的docker release
- 跨架構arm/x86/amd
rancheros技術架構
Rancheros官方:
- https://rancher.com/docs/os/v1.x/en/
- https://github.com/rancher/os
01、下載rancheros
###硬件最低配置
部署在vmware主機中
###下載rancheros
- v1.5.4 - Docker 18.09.08 - Linux 4.14.138
- https://releases.rancher.com/os/v1.5.4/rancheros.iso
- https://releases.rancher.com/os/v1.5.4/vmware/rancheros.iso
02、vmware安裝到硬盤中
注意:默認iso載入,重啟數據會丟失。默認賬戶rancher自動登錄
###掛載rancheros啟動
###自動登錄進去自動獲取IP信息
###設置rancher密碼
sudo passwd rancher //暫且設置rancher/rancher,默認是沒有密碼的,可以tail /etc/shadow |grep rancher,網上的很多扯淡的話
####xshell登錄rancheros
####配置cloud-config.yml
生成rsa秘鑰對,安裝到硬盤默認不允許遠程登錄(主要是為了安全)
###cloud-config.yml
###cloud-config.yml
rancher: docker: registry_mirror: https://registry.docker-cn.com network: interfaces: eth0: address: 192.168.3.15/24 gateway: 192.168.3.1 mtu: 1500 dhcp: false dns: nameservers: - 223.5.5.5 - 223.6.6.6 ssh_authorized_keys: - ssh-rsa xxx //填寫rsa公鑰
注意:上面信息請根據具體的情況修改即可,切不可照搬
###查看硬盤設備命名
###rancheros ros install --help //命令幫助
sudo ros install --cloud-config cloud-config.yml --device /dev/sda //兩次y確認
注意:安裝完畢,移除iso
###登錄系統,sudo system-docker ps //查看系統運行的容器,非用戶層次的 docker ps
###用戶使用的docker容器