Run Gui application in a Docker

This post was originally released on 14th of January

RunIT Browser was first introduced in PostX Gnu/Linux Debian base. Now, since Fedora base is coming there are dependency issues, which will inhibit RunIT functionality.

One way to run the browser is via Docker. With below commands you can easily run RunIT Browser in a docker container. Here I will be running a Debian Stretch based container.

On a local machine

#xauth list –> Copy the code after COOKIE-1 or similar. This might be needed on some cases.

sudo su

Install docker and start the service.

yum -y install docker
systemctl start docker.service
exit

Exit gets us out from root account. If you are using sudo then ignore the exit command.

Accept docker connections as a normal user (not sudo or root).

xhost +local:docker

sudo docker run -it –net=host -e DISPLAY -v /tmp/.X11-unix debian:stretch /bin/bash

The above command runs docker in interactive mode and attaches a terminal into it and also gets the network connection from our local machine. Furthermore the process is directed to X11-unix, which will give Gui and then Debian is fetched and the shell is specified to become bash.

Within the container

apt-get update
apt-get dist-upgrade -y
apt-get install wget python-pyqt5 ca-certificates python-pyqt5.qtwebkit unzip xauth xserver-xorg -y

wget https://www.techtimejourney.net/wp-content/uploads/2017/08/Runit-Browser_0.6.1.x66479.zip
unzip Runit-Browser_0.6.1.x66479.zip
cd Runit
python run.py

Sometimes you may need to do:

xauth add <the code that xauth list gave you>.

However at least for me this was not the case with RunIT Browser.

RunIT start is a bit weird. Maximize the window once and the Gui problems appearing on the start will disappear.