Category Archives: Devops

How To: Move a docker container to another host

Saving this here for future reference.

If you wan’t to move a container that you’ve set up (i.e. from development to production) and you don’t yet want to push it to docker hub, here’s a way to move it:

  1. Export the container to a tarball
    docker export <CONTAINER ID> > /home/export.tar
  2. More your tarball to the new machine
  3. Import it back
    cat /home/export.tar | docker import – some-name:latest

How To: Compile Mono for FastCGI & Nginx in Ubuntu 11.10

So if you want to install mono from the comfort of apt-get you can look forward to something like version 2.10 which means that the latest and greatest MVC projects wont work, you’ll run into async issues, and a bunch of other stuff so it’s time to get down and dirty with the mono source code.

Get dependencies

sudo apt-get install build-essential autoconf automake \
bison flex gtk-sharp2-gapi boo gdb valac libfontconfig1-dev \
libcairo2-dev libpango1.0-dev libfreetype6-dev libexif-dev \
libtiff4-dev libgif-dev zlib1g-dev libatk1.0-dev libjpeg8-dev \
libjpeg-turbo8-dev libglib2.0-dev libgtk2.0-dev libglade2-dev \
libart-2.0-dev libgnomevfs2-dev libgnome-desktop-dev \
libgnome2-dev libgnomecanvas2-dev libgnomeui-dev libgnomeprint2.2-dev \
libgnomeprintui2.2-dev libpanel-applet-4-dev \
libnautilus-extension-dev librsvg2-dev libgtkhtml3.14-dev \
libgtksourceview2.0-dev libgtksourceview2.0-dev libvte-dev \
libwnck-dev libnspr4-dev libnss3-dev libwebkit-dev libvala-0.18-dev

Get the source

First we’ll need the following sourcecode:

  • libgdiplus: An Open Source implementation of the GDI+ API. [latest snapshot – see below]
  • mono: Mono open source ECMA CLI, C# and .NET implementation [release 3.2.5]
  • XSP: Monos ASP.NET hosting server. Includes an apache module, fastCGI module and standalone server [release 3.0.11]

note: if we get the latest release version of libgdiplus you may run into an issue during make

/usr/bin/ld: testgdi.o: undefined reference to symbol ‘g_print’
/usr/bin/ld: note: ‘g_print’ is defined in DSO /lib/x86_64-linux-gnu/ so try adding it to the linker command line

getting the latest version linked above includes the pull request that fixes this issue.


Untar/unzip each of the archives:

unzip # unzip libgdiplus
tar -zxf 3.2.5 # untar mono
tar -zxf 3.0.11.tar.gz # untar XSP

for each project the process is exactly the same (before you do this though, read the section on uninstalling below)

# change to project directory (mono in this example)
cd mono
# run autogen to configure the build
./ --prefix=/usr
# build
# install
make install

You may run into missing packages depending on your system configuration, but usually apt-get install the missing dependency is all you really need to do.

Configuring Nginx and FastCGI

coming soon, no really…


I have in the past stayed away from building software on my production server as it can be a pain to remove or upgrade but I’ve found a great tool called CheckInstall. What this does is keep track of the files being copied during the ‘make install’ step and gives you a handy .deb or .rpm file which you can then use to uninstall (or even use this file on other systems instead of having to repeat the build)

To use it, replace ‘sudo make install’ with ‘sudo checkinstall’