Mac019--Ubuntu上安裝Rancher

首先安裝:VisualBox虛擬機。html

下載:ubuntu鏡像 (ubuntu基於linux的免費開源桌面PC操做系統)linux

===================================================docker

上述請參考:Mac018ubuntu

Ubuntu上安裝Rancher

參考:https://www.linuxidc.com/Linux/2018-02/151097.htm瀏覽器

1。什麼是Rancher

Rancher是運行容器和構建私有容器服務的開源平臺。服務器

Rancher基於Docker,所以您能夠在專用的box,KVM機器上甚至LXC容器上運行它。less

Rancher提供了一個龐大的應用程序庫,只需點擊幾下便可安裝,而且還支持來自Dockerhub的Docker鏡像。curl

2。安裝Rancher前須要先安裝Docker(Docker須要運行Rancher)

//Step1:先刪除全部舊的Docker文件
sudo apt-get remove docker docker-engine docker.io

//Step2:更新軟件包列表
sudo apt-get update

//Step3:容許apt經過HTTPS使用存儲庫。
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

//Step4:添加官方的GPG密鑰。
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

//Step5:經過搜索密鑰指紋的最後8位數字來驗證您是否擁有密鑰。
sudo apt-key fingerprint 0EBFCD88


###輸出將相似於如下文本。####################
pub  4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) <docker@docker.com>
sub  4096R/F273FCD8 2017-02-22
####################################

//Step6:添加一個穩定的repo。
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

//Step7:再次更新軟件包列表。
sudo apt-get update

//Step8:檢查Docker CE的可用版本。
apt-cache madison docker-ce

####您將看到相似於如下塊的輸出。################
docker-ce | 17.09.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 17.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 17.06.2~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 17.06.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 17.06.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 17.03.2~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages

在如下命令中追加=後的最新穩定版本的版本字符串(第二列)以安裝最新版本的Docker CE。
########################################

//Step9:選擇一個合適的版本,替換掉=號後面的版本
sudo apt-get install docker-ce=17.09.1~ce-0~ubuntu 

########################################
注意:您能夠安裝最新版本的Docker CE,而無需將版本附加到sudo apt-get install docker-ce命令的末尾,但在生產環境中,我建議您安裝特定版本而不是最新版本。(直接輸入:sudo apt-get install docker-ce 便可)
########################################

//Step10:確認Docker安裝正確。
sudo docker run hello-world

########################################
該命令在測試容器中運行測試圖像以打印消息,而後退出。 該消息將與如下輸出相似。
Hello from Docker!
########################################

3。安裝Rancher

//Step1:安裝Rancher
sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable

##################################
等待幾分鐘讓Rancher UI啓動。 而後,打開您最喜歡的瀏覽器並轉到服務器上的端口8080。
http://192.0.2.0:8080\
請務必將192.0.2.0替換爲您的實際服務器的IP地址。
Rancher默認狀況下不配置訪問控制,所以當即設置它很是重要,不然擁有您的IP的任何人均可以訪問UI和API。
將鼠標懸停在管理員標籤上,而後點擊訪問控制。
按照Rancher UI中的說明設置您喜歡的任何形式的訪問控制。
##################################

4。配置Rancher

配置Rancher相關信息,參考官網:https://rancher.com/docs/rancher/v1.6/en/測試

相關文章
相關標籤/搜索