Commit 00285fde authored by Dmitry Kazakov's avatar Dmitry Kazakov

Remove docker environment building tools

They have been moved into a separate repository, so just
keep a README.md file pointing to it.
parent ec094919
FROM kdeorg/appimage-base
MAINTAINER Dmitry Kazakov <dimula73@gmail.com>
RUN apt-get update && \
apt-get -y install curl && \
apt-get -y install emacs24-nox && \
apt-get -y install gitk git-gui && \
apt-get -y install cmake3-curses-gui gdb valgrind sysvinit-utils && \
apt-get -y install mirage && \
apt-get -y install mesa-utils
ENV USRHOME=/home/appimage
RUN chsh -s /bin/bash appimage
RUN locale-gen en_US.UTF-8
RUN echo 'export LC_ALL=en_US.UTF-8' >> ${USRHOME}/.bashrc && \
echo 'export LANG=en_US.UTF-8' >> ${USRHOME}/.bashrc && \
echo "export PS1='\u@\h:\w>'" >> ${USRHOME}/.bashrc && \
echo 'source ~/devenv.inc' >> ${USRHOME}/.bashrc && \
echo 'prepend PATH ~/bin/' >> ${USRHOME}/.bashrc
RUN mkdir -p ${USRHOME}/appimage-workspace/krita-inst && \
mkdir -p ${USRHOME}/appimage-workspace/krita-build && \
mkdir -p ${USRHOME}/bin
COPY ./default-home/devenv.inc \
./default-home/.bash_aliases \
${USRHOME}/
COPY ./default-home/run_cmake.sh \
${USRHOME}/bin
ADD persistent/krita-appimage-deps.tar ${USRHOME}/appimage-workspace/
RUN chown appimage:appimage -R ${USRHOME}/
RUN chmod a+rwx /tmp
USER appimage
CMD tail -f /dev/null
# Krita developer environment Docker image
# [MOVED] 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.
The official Krita developers docker image has been moved into
a separate repository:
[0] - https://binary-factory.kde.org/job/Krita_Nightly_Appimage_Dependency_Build/
https://cgit.kde.org/scratch/dkazakov/krita-docker-env.git/
## Prerequisites
Here is a direct link to the README.md file:
Firstly make sure you have Docker installed
```bash
sudo apt install docker docker.io
```
Then you need to download deps and Krita source tree. These steps are not
included into the *Dockerfile* to save internal bandwidth (most Krita
developers already have al least one clone of Krita source tree).
```bash
# create directory structure for container control directory
mkdir -p krita-master/persistent
cd krita-master
# copy/chechout Krita sources to 'persistent/krita'
cp -r /path/to/sources/krita ./persistent/krita
# initialize control scripts and the Dockerfile
./persistent/krita/build-tools/docker/bin/bootstrap-root.sh
# download the deps archive
./bin/bootstrap-deps.sh
```
## Build the docker image and run the container
```bash
./bin/build_image krita-deps
./bin/run_container krita-deps krita-master
```
## Enter the container and build Krita
```bash
# enter the docker container (the name will be
# fetched automatically from '.container_name' file)
./bin/enter
# ... 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
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:
```bash
# inside the container
./persistent/qt-creator-opensource-linux-x86_64-4.6.2.run
```
To start QtCreator:
```bash
# from the host
./bin/qtcreator
```
## 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
# 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
```bash
# remove the container
sudo docker rm krita-master
# 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
echo 'DOCKER_OPTS="-g /home/devel5/docker"' >> /etc/default/docker
```
https://cgit.kde.org/scratch/dkazakov/krita-docker-env.git/tree/README.md
#!/bin/bash
if [ ! -d ./persistent ]; then
mkdir ./persistent
fi
if [ ! -f ./persistent/krita-appimage-deps.tar ]; then
(
cd ./persistent/
wget https://binary-factory.kde.org/job/Krita_Nightly_Appimage_Dependency_Build/lastSuccessfulBuild/artifact/krita-appimage-deps.tar || exit 1
)
fi
creator_major=4.6
creator_minor=2
creator_file=qt-creator-opensource-linux-x86_64-${creator_major}.${creator_minor}.run
if [ ! -f ./persistent/${creator_file} ]; then
(
cd ./persistent/
wget http://download.qt.io/official_releases/qtcreator/${creator_major}/${creator_major}.${creator_minor}/${creator_file} || exit 1
chmod a+x ${creator_file}
)
fi
#!/bin/bash
if [ -d ./persistent/krita ]; then
for i in 'bin default-home'; do
if [ ! -d "$i" ]; then
mkdir $i
fi
done
cp persistent/krita/build-tools/docker/bin/* ./bin/
cp persistent/krita/build-tools/docker/default-home/{,.}* ./default-home/
cp persistent/krita/build-tools/docker/Dockerfile ./
cp persistent/krita/build-tools/docker/README.md ./
fi
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 IMAGE_NAME" >&2
exit 1
fi
sudo docker build -t $1 .
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -ti ${container_name} sh -c "cd /home/appimage && /bin/bash -l"
#!/bin/bash
function findContainerName {
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
container_file=`${DIR}/find_up ./ -name .container_name`
if [ ! -z ${container_file} ]; then
cat ${container_file}
fi
}
function parseContainerArgs {
container_name=
if [ "$#" -ne 1 ]; then
if [ "$#" -eq 0 ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
container_name=$(findContainerName)
fi
if [ -z ${container_name} ]; then
echo "Usage: $0 CONTAINER_NAME" >&2
exit 1
fi
else
container_name=$1
fi
echo ${container_name}
}
#!/bin/bash
set -e
path="$1"
shift 1
while [[ $path != / ]];
do
find "$path" -maxdepth 1 -mindepth 1 "$@"
# Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)"
path="$(readlink -f "$path"/..)"
done
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
if [ ! -e /proc/driver/nvidia/version ]; then
echo "Cannot find NVIDIA bestion file: /proc/driver/nvidia/version"
exit 1
fi
nvidia_version=$(cat /proc/driver/nvidia/version | head -n 1 | awk '{ print $8 }')
driver_file=NVIDIA-Linux-x86_64-${nvidia_version}.run
driver_url=http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_version}/${driver_file}
if [ ! -f persistent/${driver_file} ]; then
(
cd persistent
wget http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_version}/${driver_file} || exit 1
chmod a+x ${driver_file}
)
fi
if [ -f persistent/${driver_file} ]; then
sudo docker exec -ti -u root ${container_name} /home/appimage/persistent/${driver_file} -a -N --ui=none --no-kernel-module -s
else
echo "Cannot find the driver file: ${driver_file}"
exit 1
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -ti ${container_name} /bin/bash -c 'source /home/appimage/devenv.inc; /home/appimage/qtcreator/bin/qtcreator.sh'
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 IMAGE_NAME CONTAINER_NAME" >&2
exit 1
fi
NVIDIA_OPTS=
if [ -e /dev/nvidiactl ]; then
NVIDIA_OPTS+="--device /dev/nvidia0 --device /dev/nvidiactl --device /dev/nvidia-uvm"
fi
sudo docker run -P -t -d \
-v $(pwd)/persistent/:/home/appimage/persistent/:rw \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
-v /home/$USER/.Xauthority:/home/appimage/.Xauthority \
-v /etc/localtime:/etc/localtime:ro \
-e DISPLAY=$DISPLAY \
-h $HOSTNAME \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
--device /dev/dri \
--device /dev/snd \
$NVIDIA_OPTS \
--name $2 \
$1 || exit 1
if [ ! -f .container_name ]; then
echo $2 > .container_name
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker start ${container_name}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker stop ${container_name}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -user root -ti ${container_name} sh -c "cd /home/appimage && /bin/bash -l"
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias gdba='gdb --args'
alias gdbr='gdb --eval-command=r --args'
alias gdbrk='gdb --eval-command=r --args krita'
alias gdbatt='gdb --eval-command=cont --pid=$(pidof krita)'
function tst {
make -j8 $1 && ./$1 $2 $3 $4 $5 $6 $7 $8
}
function tsti {
make -j8 -C .. && make -j1 -C .. install/fast && ./$1 $2 $3 $4 $5 $6 $7 $8
}
function tstfast {
make -j8 $1/fast && ./$1 $2 $3 $4 $5 $6 $7 $8
}
function mi {
make -j8 && make -j1 install/fast
}
function mik {
make -j8 && make -j1 install/fast && krita $*
}
function nmik {
nice make -j8 && nice make -j1 install/fast && krita $*
}
prepend() { [ -d "$2" ] && eval $1=\"$2\$\{$1:+':'\$$1\}\" && export $1 ; }
export KRITADIR=/home/appimage/appimage-workspace/krita-inst
export DEPSDIR=/home/appimage/appimage-workspace/deps/usr
prepend PATH $KRITADIR/bin
prepend LD_LIBRARY_PATH $KRITADIR/lib64
prepend LD_LIBRARY_PATH $KRITADIR/lib
#prepend XDG_DATA_DIRS $KRITADIR/share
prepend PKG_CONFIG_PATH $KRITADIR/lib64/pkgconfig
prepend PKG_CONFIG_PATH $KRITADIR/lib/pkgconfig
prepend PATH $DEPSDIR/bin
prepend LD_LIBRARY_PATH $DEPSDIR/lib64
prepend LD_LIBRARY_PATH $DEPSDIR/lib
#prepend XDG_DATA_DIRS $DEPSDIR/share
prepend PKG_CONFIG_PATH $DEPSDIR/lib64/pkgconfig
prepend PKG_CONFIG_PATH $DEPSDIR/lib/pkgconfig
prepend CMAKE_PREFIX_PATH $DEPSDIR
#prepend PYTHONPATH $DEPSDIR/lib/python3.5/
prepend PYTHONPATH $DEPSDIR/sip
#prepend PYQT_SIP_DIR_OVERRIDE $DEPSDIR/share/sip
#!/bin/bash
cmake -DCMAKE_INSTALL_PREFIX=${KRITADIR} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING=TRUE \
-DHIDE_SAFE_ASSERTS=FALSE \
-DPYQT_SIP_DIR_OVERRIDE=~/appimage-workspace/deps/usr/share/sip \
$@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment