I am using a Jiffybox provided by DomainFactory for building a Docker container for Kolab 3.1 running on CentOS 6.

I have installed Ubuntu 12.04 LTS on a Jiffybox.
I am therefore following Docker Installation instructions for Ubuntu for the installation instructions:

Install a kernel that is required by Docker:

sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

After that, in the admin website of JiffyBox, select the custom kernel Bootmanager 64 Bit (pvgrub64); see also the german JiffyBox FAQ. Then restart your JiffyBox.

After the restart, uname -a should show something like:

Linux 3.8.0-37-generic #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Now install docker:

sudo apt-key adv --keyserver --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker

Create a Docker image
I realised that if I would install Kolab in one go, the image would become too big to upload to
Therefore I have created a Dockerfile which has several steps for downloading and installing various packages. For a detailed description of a Dockerfile, see the Dockerfile Reference

My Dockerfile looks like this:

FROM centos
RUN mv /etc/localtime /etc/localtime.old; ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN echo "" > /etc/sysconfig/network; echo "" > /proc/sys/kernel/hostname
RUN chmod a+w /dev/shm
RUN wget -O master.tar.gz; tar xzf master.tar.gz; rm master.tar.gz
WORKDIR /root/kolab3_tbits_scripts-master/kolab3.1
RUN sed -i -e "s/^yum -y install kolab.*/#yum -y install kolab/"
RUN echo "y" | ./ CentOS_6
# split yum -y install kolab into several steps,
# to keep the revisions small enough to avoid problems with uploading the image
RUN yum -y install php-kolabformat
RUN yum -y install mysql-server
RUN yum -y install kolab-cli
RUN yum -y install kolab-imap
RUN yum -y install 389-ds-base
RUN yum -y install java-1.6.0-openjdk
RUN yum -y install libgcj
RUN yum -y install kolab-ldap
RUN yum -y install kolab-webadmin
RUN yum -y install iRony
RUN yum -y install wallace
RUN yum -y install kolab-webclient
RUN yum -y install postfix
RUN yum -y install clamd
RUN yum -y install kolab-mta
RUN yum -y install qt-x11
RUN yum -y install libkolab
RUN yum -y install kolab patch unzip
# prepare for setup kolab
RUN ./
# we cannot run setup-kolab here, because the hostname is no FQDN
# RUN setup-kolab --default --timezone=Europe/Brussels --directory-manager-pwd=test
# allow connections on port 443 (https)
# TODO: allow IMAP as well
#CMD ["/sbin/init"]

This command will build a container with the instructions from the Dockerfile in the current directory. When the instructions have been successful, an image with the name tpokorra/kolab31_centos6 will be created, and the container will be deleted:

sudo docker build -t tpokorra/kolab31_centos6 .

You can see all your local images with this command:

sudo docker images

To finish the container, we need to run setup-kolab, this time we define a hostname as a parameter:

MYAPP=$(sudo docker run --name centos6_kolab31 -h -d -t -i tpokorra/kolab31_centos6 /bin/bash)
docker attach $MYAPP
# run inside the container:
  echo `hostname -f` > /proc/sys/kernel/hostname
  setup-kolab --default --timezone=Europe/Brussels --directory-manager-pwd=test
  cat > /root/ << EOF
service httpd start
service mysqld start
service dirsrv start
service cyrus-imapd start
sleep 10
service kolabd start
service kolab-saslauthd start
  chmod a+x /root/
  service kolabd stop
  service dirsrv stop
  service cyrus-imapd stop
  service mysqld stop
  service httpd stop

Typing exit inside the container will stop the container.

Now you commit this last manual change:

docker commit $MYAPP tpokorra/kolab31_centos6
# delete the container
docker rm $MYAPP

You can push this image to

#create a new account, or login with existing account:
sudo docker login
sudo docker push tpokorra/kolab31_centos6

You can now see the image available here:

See this post Installing Demo Version of Kolab 3.1 with Docker about how to install this image on the same or a different machine, for demo and validation purposes.

Current status: There are still some things not working fine, and I have not tested everything.
But this should be a good starting point for other people as well, to help with a good demo installation of Kolab on Docker.

Building a Docker container for Kolab on Jiffybox
Tagged on: