Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

README.md 2.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
# Krita developer environment Docker image

This *Dockerfile* is based on the official KDE build environmet [0]
that in used on KDE CI for building official AppImage packages.
Therefore running this image in a docker container is the best way
to reproduce AppImage-only bugs in Krita.

[0] - https://binary-factory.kde.org/job/Krita_Nightly_Appimage_Dependency_Build/

## Prerequisites

Firstly we need to download deps and Krita source tree. These steps are not
Boudewijn Rempt's avatar
Boudewijn Rempt committed
13
included into the *Dockerfile* to save internal bandwidth (most Krita
14 15 16 17 18 19 20
developers already have al least one clone of Krita source tree).

```bash
# download the deps archive
./bin/bootstrap-deps.sh

# mount/copy/chechout Krita sources to 'persistent/krita'
Dmitry Kazakov's avatar
Dmitry Kazakov committed
21
cp -r /path/to/sources/krita ./persistent/krita
22 23 24 25 26 27
```

## Build the docker image and run the container

```bash
./bin/build_image krita-deps
Dmitry Kazakov's avatar
Dmitry Kazakov committed
28
./bin/run_container krita-deps krita-master
29 30 31 32 33
```

## Enter the container and build Krita

```bash
Dmitry Kazakov's avatar
Dmitry Kazakov committed
34 35 36 37
# enter the docker container (the name will be
# fetched automatically from '.container_name' file)

./bin/enter
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

# ... now your 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

```

## Extra developer tools

Dmitry Kazakov's avatar
Dmitry Kazakov committed
53 54 55
To install QtCreator, enter 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:
56 57 58

```bash
# inside the container
Dmitry Kazakov's avatar
Dmitry Kazakov committed
59 60
./persistent/qt-creator-opensource-linux-x86_64-4.6.2.run
```
61

Dmitry Kazakov's avatar
Dmitry Kazakov committed
62
To start QtCreator:
63

Dmitry Kazakov's avatar
Dmitry Kazakov committed
64 65 66
```bash
# from the host
./bin/qtcreator
67 68 69 70 71 72 73 74 75
```

## Stopping the container and cleaning up

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).

```bash
Dmitry Kazakov's avatar
Dmitry Kazakov committed
76 77 78 79 80
# stop the container
./bin/stop

# start the container
./bin/start
81 82 83 84 85 86
```

If you don't need your container/image anymore, you can delete them from the docker

```bash
# remove the container
Dmitry Kazakov's avatar
Dmitry Kazakov committed
87
sudo docker rm krita-master
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110

# remove the image
sudo docker rmi krita-deps
```

TODO: do we need some extra cleaups for docker's caches?


## Troubleshooting

### Krita binary is not found after the first build

Either relogin to the container or just execute `source ~/.devenv.inc`


### Not enough space on root partition

All the docker images and containers are 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.

```bash
111
echo 'DOCKER_OPTS="-g /home/devel5/docker"' >> /etc/default/docker
112
```