新聞中心
介紹

Rancher是運行容器和構(gòu)建私有容器服務(wù)的開源平臺。 Rancher基于Docker,因此您可以在專用的box,KVM機器上甚至LXC容器上運行它。 Rancher提供了一個龐大的應(yīng)用程序庫,只需點擊幾下即可安裝,并且還支持來自Dockerhub的Docker鏡像。
要求
- 一個Vultr實例ubuntu 16.04 x64。
- 至少1GB內(nèi)存。
- 受支持的Docker版本。
安裝Docker
如上所述,Docker需要運行Rancher,所以我們會先安裝它。
首先,如有必要,刪除所有舊的Docker文件。
sudo apt-get remove docker docker-engine docker.io
注意:您可能會收到?jīng)]有安裝Docker文件的報告。 這是可以忽略的。
更新軟件包列表。
sudo apt-get update
允許apt通過HTTPS使用存儲庫。
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
添加官方的GPG密鑰。
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
通過搜索密鑰指紋的最后8位數(shù)字來驗證您是否擁有密鑰。
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)
sub 4096R/F273FCD8 2017-02-22
添加一個穩(wěn)定的repo。
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
再次更新軟件包列表。
sudo apt-get update
檢查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
在以下命令中追加=后的最新穩(wěn)定版本的版本字符串(第二列)以安裝最新版本的Docker CE。
sudo apt-get install docker-ce=17.09.1~ce-0~ubuntu
注意:您可以安裝最新版本的Docker CE,而無需將版本附加到sudo apt-get install docker-ce命令的末尾,但在生產(chǎn)環(huán)境中,我建議您安裝特定版本而不是最新版本。
確認Docker安裝正確。
sudo docker run hello-world
該命令在測試容器中運行測試圖像以打印消息,然后退出。 該消息將與以下輸出類似。
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
安裝Rancher
現(xiàn)在我們準(zhǔn)備安裝Rancher。
sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable
等待幾分鐘讓Rancher UI啟動。 然后,打開您最喜歡的瀏覽器并轉(zhuǎn)到服務(wù)器上的端口8080。
http://192.0.2.0:8080
請務(wù)必將192.0.2.0替換為您的實際服務(wù)器的IP地址。
Rancher默認情況下不配置訪問控制,因此立即設(shè)置它非常重要,否則擁有您的IP的任何人都可以訪問UI和API。
將鼠標(biāo)懸停在管理員標(biāo)簽上,然后點擊訪問控制。
按照Rancher UI中的說明設(shè)置您喜歡的任何形式的訪問控制。
結(jié)論
現(xiàn)在已經(jīng)安裝了所有東西,您可以開始配置Rancher。 有關(guān)配置和使用Rancher的更多深入信息,請訪問其官方文檔。
當(dāng)前標(biāo)題:在Ubuntu16.04上安裝Rancher
文章起源:http://m.fisionsoft.com.cn/article/dpejsgj.html


咨詢
建站咨詢
