Archive

Posts Tagged ‘docker’

Installing RancherOS and Rancher

March 5th, 2017 No comments

Install RancherOS

RancherOS installation docs are available at these links.

Docs are available here and here.

I found the docs a bit confusing so have included the steps I used here:

OS installation:

By default, any changes won’t persist and will be lost on reboot. The following steps explain how to install the OS on your hard disk:

Configure a new Linux 4.x compatible VM (>1.5G ram) and boot the memory based OS from CD. Get the most recent ISO release here.

When booted from CD, a shell for user rancher starts on the console. Unless your console allows cut/paste, you’ll want to set a password for user rancher to allow SSH login. SSH key howto.

$ sudo passwd rancher

Login using SSH ($ ssh [email protected])
. Note: this key will not survive a reboot, so in the following steps decline any offers to reboot.

Place your public SSH key in /home/rancher/cloud-config.yml using the following format:

#cloud-config.yml
hostname: myhost (optional)
ssh_authorized_keys:
– ssh-rsa AAAAB3NzaC1y…qKxUCAnBOcZ [email protected]
[there should be a couple of spaces at the beginning of the previous line, before the dash]

Format the drive where you want to install rancherOS. This command also labels the drive as required by Rancher. Ignore the rancher doc suggestion to reboot after this command.

$ sudo mkfs.ext4 -L RANCHER_STATE /dev/sda (may not be /dev/sda – with kvm, i use /dev/vda)

Now install RancherOS to disk, along with the SSH key you provided:


$ sudo ros install -c cloud-config.yml -d /dev/sda (again, change sda if necessary)

Reply Y to continue, and then Y to reboot.

If you need to change the hostname:

$ sudo ros config set hostname

Install Rancher Server and Agent

Rancher quick-start doc can be found here.

However Rancher Server is incredibly easy to install. This one liner will do the trick:

$ sudo docker run -d –restart=unless-stopped -p 8080:8080 rancher/server
(WordPress messes up <dash><dash>restart in the line above)

Once Rancher Server and its UI are up and running, you’ll need to install Rancher Agent on each Docker host (including RancherOS hosts). The Rancher UI explains the process clearly and makes it easy.

Categories: Docker, Linux Tags: , , , ,

Install Latest Docker on Ubuntu Trusty 14.04 (LTS)

October 28th, 2014 No comments

From Docker’s site:

Ubuntu Trusty 14.04 (LTS) (64-bit)

Ubuntu Trusty comes with a 3.13.0 Linux kernel, and a docker.io package which installs Docker 0.9.1 and all its prerequisites from Ubuntu’s repository.

Note: Ubuntu (and Debian) contain a much older KDE3/GNOME2 package called docker, so the package and the executable are called docker.io.

Installation

To install the latest Ubuntu package (may not be the latest Docker release):

$ sudo apt-get update
$ sudo apt-get install docker.io
$ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
$ sudo sed -i '$acomplete -F _docker docker'/etc/bash_completion.d/docker.io
$ source /etc/bash_completion.d/docker.io

If you’d like to try the latest version of Docker:

First, check that your APT system can deal with https URLs: the file /usr/lib/apt/methods/httpsshould exist. If it doesn’t, you need to install the package apt-transport-https.

[-e /usr/lib/apt/methods/https ]||{
  apt-get update
  apt-get install apt-transport-https
}

Then, add the Docker repository key to your local keychain.

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

Add the Docker repository to your apt sources list, update and install the lxc-docker package.

You may receive a warning that the package isn’t trusted. Answer yes to continue installation.

$ sudo sh -c "echo deb https://get.docker.com/ubuntu docker main
> /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker

Note:

There is also a simple curl script available to help with this process.

$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh

To verify that everything has worked as expected:

$ sudo docker run -i -t ubuntu /bin/bash

Which should download the ubuntu image, and then start bash in a container.

Docker Inspect Tricks

August 16th, 2014 No comments

Docker inspect provides all sorts of useful information. Use with no format to get all values, then use –format to filter.

This example gets the complete container Id:

docker inspect –format='{{.Id}}’ $SHORT_CONTAINER_ID

 

 

Categories: Linux Tags: , , , ,

Enable IP Broadcast on Linux Bridge

August 16th, 2014 No comments

While packaging minidlna in a Docker container, it became clear that IP Broadcasts (required by minidlna) are not bridged by default in Ubuntu 14.04.

Adding the following file (10-fix-bridge.conf) with the following to /etc/sysctl.d/ fixes this:

# allows broadcasts to reach Docker containers
#net.bridge.bridge-nf-call-arptables = 1
#net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 0

Categories: Linux Tags: , , , , , ,