-----------------------------------------------------------
  HOWTO run X app in docker
-----------------------------------------------------------

June 2022

Prerequisities:

1] docker

2] DISPLAY variable set (e.g.: export DISPLAY=:0.0)
   and tested so running X app would appear on display
   when run

-----------------------------------------------------------
  The problem:
-----------------------------------------------------------

1] We want to display X app from docker on host machine 

-----------------------------------------------------------
  HOWTO solve it:
-----------------------------------------------------------

1] create file named Dockerfile

--- CUT HERE ---
# get latest debian
FROM debian:latest

RUN apt-get update && apt-get -y install bash x11-apps
--- CUT HERE ---

2] build docker guest using:

$ docker build -t "x11-test:latest" .

3] run the docker guest

$ docker run -it \
  --rm -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  --name=x11-test \
  x11-test:latest \
  /bin/bash

4] test it using:

dokrmach$ xclock &

-----------------------------------------------------------
  Result:
-----------------------------------------------------------

  The xclock should appear on the host X display.

  Till next time...