Docker.io & Shipyard Ubuntu 14.04 Trusty Tahr install

docker.io pack, ship and run any application as a lightweight container Docker is an Open Source container based virtualisation framework which provides features over and above LXC. Docker is also tightly integrated into OpenStack Icehouse, enabling a Docker container to be used in-place of a VM hypervisor (or additionally, inside a VM) in Nova with orchestration via a Heat plug-in.

Shipyard Open Source Docker Management

Shipyard is an Open Source docker Graphical User Interface created by Evan Hazlett using python django. It offers Multi-Host support, Container metrics and RESTful API.

The guides at docker.io and shipyard are not yet fully up to date for Ubuntu 14.04 Trusty Tahr LTS release, so I thought I’d share some insights from my recent install and configuration.

The quickstart at shipyard and the blog at docker.io is my main source, along with tried and tested troubleshooting.

tl;dr

Essentially docker is now docker.io in most config files and commands.

docker.io is the new package name in Ubuntu 14.04, don’t use the old instructions referring to lxc-docker

Docker.io Install

A simple one-liner install now for Docker in Ubuntu 14.04:

sudo apt-get install docker.io

 

Add the relevant user to the docker group, which should already be created by default:

sudo usermod -a -G docker {{your_user}}

docker.io.conf is the new configuration file at /etc/init/docker.io.conf which uses upstart, so we now need to make configuration changes in the /etc/default/docker.io Upstart Configuration file:

# Docker Upstart and SysVinit configuration file

# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"

# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4" ## note: config file is left verbatim as provided, but use --dns (double dashes) to configure dns successfully

# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"

# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"

** Note: The original config file example shows the dns option with single dash “-“, however docker.io in Ubuntu 14.04 needs two dashes “--” to successfully configure dns. Refer to the articles here by docker and on Ask Ubuntu

Configuration

So to add the correct shipyard configuration, edit the /etc/default/docker.io file DOCKER_OPTS section as follows:

DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"

Note as per the source shipyard quickstart guide: “…this will only bind to the localhost address. If you would like to access the API tcp port externally replace 127.0.0.1 with 0.0.0.0”

 

Restart

Restart the docker.io upstart service to enable the configuration file changes:

sudo service docker.io stop
sudo service docker.io start

Shipyard Deploy

Then deploy shipyard on the docker host as follows (refer to the source shipyard quickstart and Shipyard Deploy for what is happening here):

sudo docker.io run -i -t -v /var/run/docker.sock:/docker.sock shipyard/deploy setup

It should then first look locally, if nothing found then pull down the latest shipyard repo build and configs. In about 5 minutes (once the downloads and builds are complete) you can then run the shipyard UI.

By William Cho [CC-BY-SA-2.0 (http://creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons

Security

Shipyard as yet has no Docker host authentication security, so you must maintain a secure environment through a crafty combination of Docker host IP firewall (or OpenStack Security Group Rules) and user/group access control. To enable shipyard UI access, ensure you configure shipyard host security, enable TCP on port 8000 in your firewall (e.g. UFW) and Security Group Rules in OpenStack (if you are running Docker host in an OpenStack tenant).

Change your admin password to something complex after logging in. From the Site Administration accessed from the top right drop down “administration” menu, then select “Change” in users four items down the Site Administration page. Click on your user “admin” then select the “this form” hyperlink in the Password section. Be aware this is plain HTTP, so ensure you are making password changes only via a secure VPN connection.

Go forth and add other docker hosts to shipyard using the guide for configuring the Shipyard Agent. Docker can also be configured for IPv6, as opposed to the default IPv4.
Docker and Shipyard are both provided under Apache License, Version 2.0

Advertisements

Focus on enabling successful business technology outcomes. I believe that Open wins over Closed and that a diverse eco-system is essential for interoperability to avoid vendor lock-in. This approach is essential for any enterprise considering hybrid cloud. Principal Solutions Architect ANZ at Nuage Networks

Tagged with: , , , , , , , , , , , , , , , ,
Posted in Uncategorized
6 comments on “Docker.io & Shipyard Ubuntu 14.04 Trusty Tahr install
  1. wjgeorge says:

    looks like docker.io wants “–dns” in its .conf file

  2. Would it be better to replace

    “sudo usermod -a -G docker {{your_user}}”

    with

    “whoami | xargs sudo usermod -a -G docker “

    • Hi Shrivats, only if you are wanting to issue commands as the current logged in user would your bash command make sense. In my code example I have a specific docker user in mind, not necessarily what I am currently logged in or issuing the command from; rather {your_user} signifies a specifically assigned docker user for the docker environment you are creating. Take a look at the hyperlinks I’ve provided within the article on security, which offer further detail and background on this topic.

  3. The command to install shipyard did not work in my environment.

    $sudo docker.io run -i -t -v /var/run/docker.sock:/docker.sock shipyard/deploy setup

    This worked (minus the dot io)

    $sudo docker run -i -t -v /var/run/docker.sock:/docker.sock shipyard/deploy setup

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Twitter Feed
%d bloggers like this: