The Dockerfile is based on the official KDE build environment that is used on KDE CI for building official AppImage packages. This guide is valid for Ubuntu and Ubuntu-based Linux distributions.
First make sure you have Docker installed
sudo apt install docker docker.io
Decide where you want to store your Docker images. All the docker images and containers are by default stored in a special docker-daemon controlled folder under /var directory. You might not have enough space there for building Krita (it needs about 10 GiB). In such a case it is recommended to move the docker images folder into another location, where there is enough space.
# this step is optional echo 'DOCKER_OPTS="-g /path/where/you/want/to/store/docker/images/"' >> /etc/default/docker
Then you need to download deps and Krita source tree. These steps are not included into the Dockerfile to save internal bandwidth
# create directory structure for container control directory git clone git://anongit.kde.org/scratch/dkazakov/krita-docker-env.git krita-auto-1 cd krita-auto-1 mkdir persistent # copy/checkout Krita sources to 'persistent/krita' cp -r /path/to/sources/krita ./persistent/krita ## or ... # git clone kde:krita persistent/krita # download the deps archive ./bin/bootstrap-deps.sh
./bin/build_image krita-deps ./bin/run_container krita-deps krita-auto-1
# enter the docker container (the name will be # fetched automatically from '.container_name' file) ./bin/enter
… now you are inside the container with all the deps prepared …
# build Krita as usual cd appimage-workspace/krita-build/ run_cmake.sh ~/persistent/krita make -j8 install # start Krita krita
To install QtCreator, enter the container and start the installer, downloaded while fetching dependencies. Make sure you install it into ‘~/qtcreator’ directory without any version suffixes, then you will be able to use the script below:
# inside the container ./persistent/qt-creator-opensource-linux-x86_64-4.6.2.run
To start QtCreator:
# from the host ./bin/qtcreator
When not in use you can stop the container. All your filesystem state is saved, but all the currently running processes are killed (just ensure you logout from all the terminals before stopping).
# stop the container ./bin/stop # start the container ./bin/start
If you don’t need your container/image anymore, you can delete them from the docker
# remove the container sudo docker rm krita-auto-1 # remove the image sudo docker rmi krita-deps
Either relogin to the container or just execute source ~/.devenv.inc
The docker run script automatically forwards the GPU devices into the container, but it doesn’t install the drivers for the GPU. You should install exactly the same version of the driver that is installed on your host system. Just run the following script when you are on host: