Migrating Discourse from pkgr packages to Docker installation October 24th, 2016
Previously, I have used the discourse packages from https://packager.io/gh/pkgr/discourse because that was easy to install and to maintain, just with Ubuntu packages.
Unfortunately, those packages have not been updated for a while.
Another thing is that I can now run docker within an lxc container, which makes it easier for me to deploy docker on my root server.
So I decided to upgrade my pkgr discourse installation from 1.5.1 to the latest stable docker discourse installation.
These threads and pages have helped me:
- https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md
- https://meta.discourse.org/t/install-discourse-at-lower-version/22446/5
- https://meta.discourse.org/t/change-tracking-branch-for-your-discourse-instance/17014
So I created a backup of the 1.5.1 installation, within the admin dashboard, and downloaded that locally.
I created an LXC container with Fedora 24 (see https://github.com/tpokorra/lxc-scripts/issues/27).
Inside the container:
dnf install docker git which systemctl enable docker systemctl start docker mkdir /var/discourse git clone https://github.com/discourse/discourse_docker.git /var/discourse cd /var/discourse # comment last line, because we want to edit the file containers/app.yml before installing sed -i 's~./launcher bootstrap~#./launcher bootstrap~g' discourse-setup ./discourse-setup # edit containers/app.yml: # comment the line with 443:443 because I am using nginx outside of the LXC container for https # in section params, add this line: # version: v1.5.1 # I changed UNICORN-WORKERS from 6 to 2, because my forum does not have much traffic ./launcher bootstrap app && ./launcher start app |
Now I login to the new discourse installation, with the admin email address specified in discourse-setup
. Checking in the dashboard, I have version 1.5.1 indeed.
I restore the backup that I downloaded from the old server (need to make sure to enable restore first in the dashboard settings!).
Verify that the forum works.
Now upgrade Discourse to the latest stable version:
cd /var/discourse git pull sed -i "s/^ version:.*/ version: stable/g" containers/app.yml ./launcher rebuild app |
Using Fedora 25 Beta in Docker for LightBuildServer October 14th, 2016
For the LightBuildServer (LBS) I want to run some of my nightly builds already against Fedora 25 Beta, to see if I need to fix anything in the Mono packages for Fedora.
But there is no Beta image for Fedora 25 available at Docker Hub: https://hub.docker.com/_/fedora/
But here you can find an image for Fedora 25 Beta: https://getfedora.org/fi/cloud/prerelease/docker.html
So I download the image, and load the image like this:
cd /var/lib/docker wget https://download.fedoraproject.org/pub/fedora/linux/releases/test/25_Beta/Docker/x86_64/images/Fedora-Docker-Base-25_Beta-1.1.x86_64.tar.xz docker load -i /var/lib/docker/Fedora-Docker-Base-25_Beta-1.1.x86_64.tar.xz |
You can see the image listed, when typing docker images
:
REPOSITORY TAG IMAGE ID CREATED SIZE fedora-docker-base-25_beta-1.1.x86_64 latest a85629813141 8 days ago 197.8 MB |
Now I can reference it in my Dockerfile like this:
FROM fedora-docker-base-25_beta-1.1.x86_64:latest |
Make sure to use the image name in lower case.
Installing Demo Version of Kolab 3.4 with Docker June 13th, 2015
This describes how to install a docker image of Kolab.
Please note: this is not meant to be for production use. The main purpose is to provide an easy way for demonstration of features and for product validation.
This installation has not been tested a lot, and could still use some fine tuning. This is just a demonstration of what could be done with Docker for Kolab.
Preparing for Docker
I am using a Jiffybox provided by DomainFactory for downloading a Docker container for Kolab 3.4 running on CentOS 7.
I have installed Fedora 21 on a Jiffybox.
Now install docker:
sudo yum install docker-io systemctl start docker systemctl enable docker |
Install container
The image for the container is available here:
https://registry.hub.docker.com/u/tpokorra/kolab34_centos7/
If you want to know how this image was created, read my other blog post http://www.pokorra.de/2015/06/building-a-docker-container-for-kolab-3-4-on-jiffybox/.
To install this image, you need to type in this command:
docker pull tpokorra/kolab34_centos7 |
You can create a container from this image and run it:
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) |
You can see all your containers:
docker ps -a |
You should attach to the container, and inside the container change the root password:
docker attach $MYAPP # you might need to press Enter to see the login screen # login with user root and password root # enter a secure password: passwd root |
To stop the container:
docker stop $MYAPP |
To delete the container:
docker rm $MYAPP |
You can reach the Kolab Webadmin on this URL (replace localhost with the IP address of the Jiffybox):
https://localhost/kolab-webadmin. Login with user: cn=Directory Manager, password: test
The Webmail interface is available here:
https://localhost/roundcubemail.
Building a Docker container for Kolab 3.4 on Jiffybox June 13th, 2015
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.
Installing Demo Version of Kolab 3.3 with Docker September 17th, 2014
This describes how to install a docker image of Kolab.
Please note: this is not meant to be for production use. The main purpose is to provide an easy way for demonstration of features and for product validation.
This installation has not been tested a lot, and could still use some fine tuning. This is just a demonstration of what could be done with Docker for Kolab.
Preparing for Docker
I am using a Jiffybox provided by DomainFactory for downloading a Docker container for Kolab 3.3 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 j89610.servers.jiffybox.net 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 keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" sudo apt-get update sudo apt-get install lxc-docker |
Install container
The image for the container is available here:
https://index.docker.io/u/tpokorra/kolab33_centos6/
If you want to know how this image was created, read my other blog post http://www.pokorra.de/2014/09/building-a-docker-container-for-kolab-3-3-on-jiffybox/.
To install this image, you need to type in this command:
docker pull tpokorra/kolab33_centos6 |
You can create a container from this image and run it:
MYAPP=$(sudo docker run --name centos6_kolab33 -P -h kolab33.test.example.org -d -t -i tpokorra/kolab33_centos6) |
You can see all your containers:
docker ps -a |
You now have to attach to the container, and inside the container start the services:
docker attach $MYAPP /root/start.sh |
Somehow it should work to start the services automatically at startup, but I did not get it to work with CMD or ENTRYPOINT.
To stop the container, type exit on the container’s console, or run from outside:
docker stop $MYAPP |
To delete the container:
docker rm $MYAPP |
You can reach the Kolab Webadmin on this URL:
https://localhost/kolab-webadmin. Login with user: cn=Directory Manager, password: test
The Webmail interface is available here:
https://localhost/roundcubemail.
Building a Docker container for Kolab 3.3 on Jiffybox September 17th, 2014
This article is an update of the previous post that built a Docker container for Kolab 3.1: Building a Docker container for Kolab on Jiffybox (March 2014)
Preparation
I am using a Jiffybox provided by DomainFactory for building a Docker container for Kolab 3.3 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 j89610.servers.jiffybox.net 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 keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 sudo sh -c "echo deb http://get.docker.io/ubuntu 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 https://index.docker.io.
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 is available on Github: https://github.com/TBits/KolabScripts/blob/Kolab3.3/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/kolab33_centos6 will be created, and the container will be deleted:
sudo docker build -t tpokorra/kolab33_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_kolab33 --privileged=true -h kolab33.test.example.org -d -t -i tpokorra/kolab33_centos6 /bin/bash) docker attach $MYAPP # run inside the container: echo `hostname -f` > /proc/sys/kernel/hostname echo 2 | setup-kolab --default --timezone=Europe/Brussels --directory-manager-pwd=test ./initHttpTunnel.sh ./initSSL.sh test.example.org /root/stop.sh exit |
Typing exit inside the container will stop the container.
Now you commit this last manual change:
docker commit $MYAPP tpokorra/kolab33_centos6 # delete the container docker rm $MYAPP |
You can push this image to https://index.docker.io:
#create a new account, or login with existing account: sudo docker login sudo docker push tpokorra/kolab33_centos6 |
You can now see the image available here: https://index.docker.io/u/tpokorra/kolab33_centos6/
See this post Installing Demo Version of Kolab 3.3 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.
Installing Demo Version of Kolab 3.1 with Docker March 26th, 2014
This describes how to install a docker image of Kolab.
Please note: this is not meant to be for production use. The main purpose is to provide an easy way for demonstration of features and for product validation.
This installation has not been tested a lot, and could still use some fine tuning. This is just a demonstration of what could be done with Docker for Kolab.
Preparing for Docker
I am using a Jiffybox provided by DomainFactory for downloading 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 j89610.servers.jiffybox.net 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 keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" sudo apt-get update sudo apt-get install lxc-docker |
Install container
The image for the container is available here:
https://index.docker.io/u/tpokorra/kolab31_centos6/
If you want to know how this image was created, read my other blog post http://www.pokorra.de/2014/03/building-a-docker-container-for-kolab-on-jiffybox.
To install this image, you need to type in this command:
docker pull tpokorra/kolab31_centos6 |
You can create a container from this image and run it:
MYAPP=$(sudo docker run --name centos6_kolab31 -p 443:443 -h kolab31.test.example.org -d -t -i tpokorra/kolab31_centos6) |
(-P should work instead of -p 443:443 and use the ports defined by EXPOSE in Dockerfile, but that does not work for me at the moment…)
You can see all your containers:
docker ps -a |
You now have to attach to the container, and inside the container start the services:
docker attach $MYAPP /root/start.sh |
Somehow it should work to start the services automatically at startup, but I did not get it to work with CMD or ENTRYPOINT.
To stop the container, type exit on the container’s console, or run from outside:
docker stop $MYAPP |
To delete the container:
docker rm $MYAPP |
You can reach the Kolab Webadmin on this URL:
https://localhost/kolab-webadmin. Login with user: cn=Directory Manager, password: test
The Webmail interface is available here:
https://localhost/roundcubemail.
Building a Docker container for Kolab on Jiffybox March 26th, 2014
Preparation
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 j89610.servers.jiffybox.net 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 keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 sudo sh -c "echo deb http://get.docker.io/ubuntu 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 https://index.docker.io.
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 "NAME=kolab31.test.example.org" > /etc/sysconfig/network; echo "kolab31.test.example.org" > /proc/sys/kernel/hostname RUN chmod a+w /dev/shm WORKDIR /root RUN wget -O master.tar.gz https://github.com/tpokorra/kolab3_tbits_scripts/archive/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/" reinstallCentOS.sh RUN echo "y" | ./reinstallCentOS.sh 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 ./initSetupKolabPatches.sh # 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) EXPOSE 443 # 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 kolab31.test.example.org -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 ./initSSL.sh cat > /root/start.sh << EOF #!/bin/bash service httpd start service mysqld start service dirsrv start service cyrus-imapd start sleep 10 service kolabd start service kolab-saslauthd start EOF chmod a+x /root/start.sh service kolabd stop service dirsrv stop service cyrus-imapd stop service mysqld stop service httpd stop exit |
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 https://index.docker.io:
#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: https://index.docker.io/u/tpokorra/kolab31_centos6/
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.