Although this works (and it’s very cool that it does work!), it poses a serious security risk, because it exposes your host’s Xserver to the docker container, and therefore, it compromises the sandbox feature of Docker. Recent research has shown that a serious percentage of Docker templates contain (serious) unpatched security risks.
An alternative route would be to secure your host’s Xserver with AppArmour or SELinux. Or, run a vnc server within you Docker container and connect using vnc.
Although this works (and it’s very cool that it does work!), it poses a serious security risk, because it exposes your host’s Xserver to the docker container, and therefore, it compromises the sandbox feature of Docker. Recent research has shown that a serious percentage of Docker templates contain (serious) unpatched security risks.
An alternative route would be to secure your host’s Xserver with AppArmour or SELinux. Or, run a vnc server within you Docker container and connect using vnc.
Thanks for telling I didn't knew that , I will do more research on this.😄