Revision as of 07:01, 5 May 2020 by Dvratil (talk | contribs) (→‎Preparations: Update git repo URL)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

KDE PIM/Docker

To make developing KDE PIM as easy as possible we have prepared a Docker image based on the KDE Neon distribution. It contains all the dependencies necessary to compile KDE PIM, the environment for running self-compiled KDE PIM and pre-configured tool (kdesrc-build) used to build latest KDE PIM from sources.

Set up Docker

If you use KDE Neon, Ubuntu or Debian, run the following commands to install Docker and add yourself to the docker group, so you can use it:

sudo apt install docker.io xserver-xephyr
sudo usermod -aG docker $(whoami)
newgrp docker
It's important to note that any user added to the docker group is root equivalent. More information here and here.

On other distributions, please follow your distro's guide on how to set up Docker there, since the steps can differ slightly on different distributions.


First, clone the git repository with the Dockerfile and support scripts.

git clone https://invent.kde.org/dvratil/kdepim-docker.git
cd kdepim-docker

Next, create a directory where you want the sources code, build folders and everything else related to KDE PIM development to be stored. This is also where runtime data and configuration of Akonadi, Kontact and other apps you run inside the container will be stored. We will then expose this directory to the Docker container at runtime.

mkdir ~/kdepim-dev

Making OpenGL work in the container

Several parts of KDE PIM depend on OpenGL - this is due to our use of QtWebEngine, which is based on Blink and has a hard dependency on OpenGL for rendering web pages. There's no way around that and so we need to make OpenGL work in the container. Unfortunately, that is not a very straightforward process and it differs for each GPU vendor and drivers used.

NVIDIA proprietary drivers

The easiest way is to use NVIDIA's nvidia-docker from nvidia-docker Github. You can follow the instructions on the Github page regarding how to install it. The nvidia-docker will automatically find your installed NVIDIA drivers and will expose them into the Docker container at runtime, so you don't have to rebuild your container whenever you upgrade your NVIDIA drivers.

Note that if you do this, you must pass -n switch to the build.sh and run.sh scripts from the kdepim-docker.git repository.

Nouveau (NVIDIA opensource drivers)



Works out of the box



Building Docker image

In order to build the Docker image, run the build.sh script. If you are using proprietary NVIDIA drivers, run the script with the -n switch.

The command will create a Docker image called kdepim:dev.

Running the Docker container

To run the container, use the run.sh script:

run.sh $HOME/kdepim-dev

If you are using proprietary NVIDIA drivers, run the script with the -n switch:

run.sh -n $HOME/kdepim-dev

The content of the directory will be available in the container in the /home/neon/kdepim directory.

If you want to get another terminal window opened inside the same container, just run run.sh again. It will automatically create a new terminal on the already running container.


    In some systems, the container's /home/neon/kdepim directory may not be writable. If so, edit run.sh to remove the parameter :rw,z from the -v options. Then delete the container with the command docker rm kdepim-dev, and run the container again.

Building and updating KDE PIM

Once inside the container, you can use the following command to compile the entire KDE PIM suite:

kdesrc-build kde-pim

This will take a lot of time the first time, but all subsequent builds will be faster thanks to incremental builds and use of ccache. You can also use a specific repository name instead of the kde-pim group.

Check the kdesrc-build documentation for more details about using kdesrc-build. For a start, you may want to customize the -j option in the make-options option group in /home/neon/.kdesrc-buildrc.

kdesrc-build will clone all the repositories into /home/neon/kdepim/src/kde/pim. Build directories (where you can run make manually) are in /home/neon/kdepim/build/kde/pim. The binaries are installed to /home/neon/kdepim/install. The environment of the container is adjusted to work with the custom installation prefix.

Development tools

There's KDevelop and QtCreator preinstalled in the container and you can run them from there. You can also use them from outside of the container, but code completion might not work perfectly then.

You can also use any other IDE of your choice either by installing it into the container with apt-get or use it from outside of the container.


You can find more details in the Development section of our wiki. If you have any issues or questions, feel free to stop by on our IRC channel (#kontact) on freenode, or talk to us on the kde-pim mailinglist.

This page was last edited on 5 May 2020, at 07:01. Content is available under Creative Commons License SA 4.0 unless otherwise noted.