Docker 1.8

With the release of Docker 1.8 its time to install on my Ubuntu 15.04, the default package for Docker will give you version 1.5. Installing is easy you just need to subscribe to the correct repo and bingo you will get 1.8.1 or at the time you to it you may get a newer version. The following will add a key and add the correct package repository. Important! The following instruction only work for Ubuntu 15.04, with a small change to the line with  ubuntu-vivid you should be able to make this work for most Ubuntu releases.

#Lets add a repo key to our local machine
$ apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

#We need to ass the repo to our local machine, we we edit the following file (I using VIM you can use andy editor)
$ vim /etc/apt/sources.list.d/docker.list
Add or change the following line
$ deb ubuntu-vivid main

The next will remove any old docker that may be running and install the latest docker package.

$ apt-get update

$ apt-get purge lxc-docker*

$ apt-get install docker-engine

You can now do a quick version check

$ docker --version

Docker host mode for networking is cool

Docker host mode for networking is real useful, many times I need to have a container with all its container goodness but I need the same container have access to the host networking stack. This is where the magic ‘–net=host’ flag on the docker command line comes in handy. When you run a container with this flag the container will not get an isolated network stack. I have used this functionality to containerize software that normally expected to use and see the host network stack, for example OpenStack Neutron. OpenStack Neutron uses the host network namespace extensively to create software definable networking for OpenStack, by containerizing Neutron and keeping the host networking the neutron software runs happily.

You ca quickly test this this feature out,

First create a container with the above flag

#docker run --net=host -it ubuntu /bin/bash

Next do a list of the network interfaces,

#ip a

you will see the interfaces listed are the same as your host.