This article is an update of the previous post that built a Docker container for Kolab 3.3 from September 2014.

Preparation
I am using a Jiffybox provided by DomainFactory for building the Docker container.

I have installed Fedora 21 on a Jiffybox.

Now install docker:

sudo yum install docker-io
systemctl start docker
systemctl enable docker

Create a Docker image

To learn more about Dockerfiles, see the Dockerfile Reference

My Dockerfile is available on Github: https://github.com/TBits/KolabScripts/blob/Kolab3.4/kolab/Dockerfile. You should store it with filename Dockerfile in your current directory.

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/kolab34_centos7 will be created, and the container will be deleted:

sudo docker build -t tpokorra/kolab34_centos7 .

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 centos7_kolab34 -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 443:443 -h kolab34.test.example.org -d -t -i tpokorra/kolab34_centos7 /bin/bash)
docker attach $MYAPP
# you might need to press the Enter key to see the login prompt...
# login with user root and password root
# run inside the container:
echo 2 | setup-kolab --default --timezone=Europe/Brussels --directory-manager-pwd=test
cd /root/KolabScripts-Kolab3.4/kolab
./initHttpTunnel.sh
./initSSL.sh test.example.org
shutdown -h now

Now you commit this last manual change:

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

You can push this image to https://registry.hub.docker.com:

#create a new account, or login with existing account:
sudo docker login
# there is currently an issue with the Fedora 21 rpm package (docker-io-1.6.0-4.git350a636.fc21.x86_64)
# see also https://forums.docker.com/t/docker-push-error-fata-0001-respository-does-not-exist/1309/18
# solution: yum install --enablerepo=updates-testing docker-io
sudo docker push tpokorra/kolab34_centos7

You can now see the image available here: https://registry.hub.docker.com/u/tpokorra/kolab34_centos7/

See this post Installing Demo Version of Kolab 3.4 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 3.4 on Jiffybox
Tagged on: