we try to separate services / images.
First one is a image with xorg with video drivers and a custom 10-input.conf to get keyboard and mouse working. Maybe you have to do some configuration to get x-server starting dependent on your distribution you use (alpine works fine, debian needs a xwrapper modification, …).
Based on that xorg image we build a fluxbox one with just fluxbox installed and a prepared xinitrc like that
xinput enable Mouse0
xinput enable Keyboard0
“Mouse0” and “Keyboard0” matches the 10-input.conf xorg configuration. WIthout a working configuration you will have no keyboard and mouse.
A graphical docker container needs
- display env variable set “-e DISPLAY=$DISPLAY”
- each X Cointainer needs also shared /tmp/.X11-unix (share it as docker volume) to open a new app like chromium, keepassx, … which we all create as separated images / containers.
- Access to /dev/tty | /dev. To simplify we start with “–privileged” at the moment
We also install some additional packages like usb-utils (usb devices…), xhost (needed to allow containers like chromium, keepass to use the x-server!), xrandr (dual monitor setup), xterm (basic terminal support inside), …