[nSLUG] Helping users when your distro differs from theirs using Docker.io

George N. White III gnwiii at gmail.com
Fri Aug 22 09:38:25 ADT 2014


I'm often asked to help users at other sites who are having problems with
linux.  I used to keep several virtual machines going in order to have
access to different versions of linux, but now I find that Docker can do
this without the overhead of all those VM's.   As an example, a new linux
user
encountered the following error:

      sh: 1: git: not found
      Error - Could not execute system command "git --version > /dev/null

Using Docker, and knowing that I had a container with the same linux
version, but not being confident that I remember exactly how to apt-get
install git on that distro, it took a few minutes to provide a transcript
of an actual git install for the user:

  --------- [session to save space]
------------------------------------------------
$ docker run -i -t phusion/baseimage bash -i
root at 92c0d818ac4c:/# cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04, Trusty Tahr"
[...]

root at 92c0d818ac4c:/# apt-get update
[...]
Reading package lists... Done

root at 92c0d818ac4c:/# apt-get install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  git-man liberror-perl patch rsync
Suggested packages:
[...]
Setting up liberror-perl (0.17-1.1) ...
Setting up git-man (1:1.9.1-1) ...
Setting up git (1:1.9.1-1) ...
Setting up patch (2.7.1-4ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
root at 92c0d818ac4c:/# exit
  --------------------------------------------------------------------------

There is good support for Docker in Ubuntu 14.04 and derivatives, and also
in RHEL/CentOS 7.  I used Scientific Linux 7 (rc) for the above session.
Docker is built on top of LXC:

Docker - https://www.docker.io/


LXC - http://lxc.sourceforge.net/ (see: <
http://www.slideshare.net/BodenRussell/realizing-linux-containerslxc>)


Minimal Ubuntu base image modified for Docker-friendliness:
http://phusion.github.io/baseimage-docker/.

There are a number of good presentation on Docker for developers, Docker
best practices, etc.

-- 
George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20140822/3c1b4ab8/attachment.html>


More information about the nSLUG mailing list