KDE PIM/Docker: Difference between revisions

From KDE Community Wiki
Line 36: Line 36:
                   -v=$HOME/kdepim-dev:/home/neon/kdepim:rw \
                   -v=$HOME/kdepim-dev:/home/neon/kdepim:rw \
                   --privileged \ #TODO: needed?
                   --privileged \ #TODO: needed?
                  --ti \
                   kdepim-image
                   kdepim-image


Line 49: Line 50:


<code>-v=HOSTDIR:CONTAINERDIR:options</code> Mount the HOSTDIR directory as CONTAINERDIR inside the container, with the specified options
<code>-v=HOSTDIR:CONTAINERDIR:options</code> Mount the HOSTDIR directory as CONTAINERDIR inside the container, with the specified options
<code>--ti</code> Run in interactive mode (get a shell)


<code>kdepim-image</code> Name of the image to create the container from
<code>kdepim-image</code> Name of the image to create the container from

Revision as of 10:14, 30 July 2017

 
Under Construction
This is a new page, currently under construction!


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.

Building the Docker image

git clone git://anongit.kde.org/scratch/dvratil/kdepim-docker.git
cd kdepim-docker
sudo docker build . --label kdepim-image
# Now go make a coffee, this will take a while...

Next, create a directory where you want the sources code, build folders and everything else related to KDE PIM development to 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 need to use nvidia-docker run command instead of docker run.

Nouveau (NVIDIA opensource drivers)

TODO

Intel

TODO

AMD/ATI

TODO

Running the container

 sudo docker run --rm  \
                 -e DISPLAY=$DISPLAY \
                 -v=/tmp/.X11-unix:/tmp/.X11-unix:rw \
                 -v=$HOME/kdepim-dev:/home/neon/kdepim:rw \
                 --privileged \ #TODO: needed?
                 --ti \
                 kdepim-image

Remember to replace docker with nvidia-docker if you are using NVIDIA proprietary drivers.

We recommend you create an alias or a shell script to run this command so that you don't have to type it every time you want to start the container.

If you are not familiar with Docker, here's an explanation of the individual switches:

--rm The container will be deleted when you stop it and will be created freshly from the image when you start it again

-e Expose the host's $DISPLAY environment variable as DISPLAY into the Docker

-v=HOSTDIR:CONTAINERDIR:options Mount the HOSTDIR directory as CONTAINERDIR inside the container, with the specified options

--ti Run in interactive mode (get a shell)

kdepim-image Name of the image to create the container from

Using the container

[TODO]