Skip to content

Instantly share code, notes, and snippets.

@envieid0c
Forked from ochinchina/rancheros_install.md
Created May 1, 2019 06:54
Show Gist options
  • Save envieid0c/f35667636bd777244e63c28f65bf9269 to your computer and use it in GitHub Desktop.
Save envieid0c/f35667636bd777244e63c28f65bf9269 to your computer and use it in GitHub Desktop.
rancheros installation & rancher usage

##install rancheros to disk download the rancheros from https://releases.rancher.com/os/latest/rancheros.iso start the rancheros from the downloaded rancheros.iso. After the rancheros is started, login with user/password rancher/rancher,

if your machine is behind the proxy, you can download the rancher/os:v.x.y.z from a machine which docker is installed:

$ docker pull rancher/os:v.x.y.z
$ docker save -o rancheros_v.x.y.z.tar rancher/os:v.x.y.z

Then get the saved image rancheros_v.x.y.z.tar and copy it to the machine that the rancheros.iso is booted and execute following command to load the rancher/os:v.x.y.z into the system docker:

$ sudo system-docker load -i rancherox_v.x.y.z.tar

and then install the rancher/os with following command:

$ sudo ros install -d /dev/sda -c cloud-config.yaml

For how to create cloud init configure file cloud-config.yaml, please refer the cloudinit document.

##set the proxy for user docker

Using following command to set the proxy for user level docker

$ sudo ros config merge << "EOF"
rancher: 
  docker:
    environment:
    - HTTP_PROXY=http://<your_http_proxy>:<port_number>
    - HTTPS_PROXY=https://<your_https_proxy>:<port_number>
EOF

or edit file /var/lib/rancher/conf/cloud-config.yml and put the following information to this file

rancher: 
  docker:
    environment:
    - HTTP_PROXY=http://<your_http_proxy>:<port_number>
    - HTTPS_PROXY=https://<your_https_proxy>:<port_number>

##Auto-restart the docker

/opt/rancher/bin/start.sh

$ sudo mkdir -p /opt/rancher/bin
$ echo “sudo system-docker start busydash” | sudo tee -a /opt/rancher/bin/start.sh
$ sudo chmod 755 /opt/rancher/bin/start.sh

##start rancher/server

if the rancher is behind proxy, start it with following command:

$ sudo docker run -e http_proxy=http://proxy.example.com:8080 \
-e https_proxy=https://proxy.example.com:8080 \
-e no_proxy="localhost,127.0.0.1" \
-d --restart=always \
-p 8080:8080 rancher/server

if no proxy is set, remove the proxy setting and start the rancher serer with following command:

$ sudo docker run -d --restart=always -p 8080:8080 rancher/server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment