所有的 Unix-like GUI Application 都需要 XServer, 但 container 裡面沒有. 所以我們把 host 上的 XServer 對應給 container.
作法如下:
- Share the Host’s XServer with the Container by creating a volume
- --volume="$HOME/.Xauthority:/root/.Xauthority:rw"
- share the Host’s DISPLAY environment variable to the Container
- --env="DISPLAY"
- run container with host network driver with
- --net=host
Reference
https://medium.com/@SaravSun/running-gui-applications-inside-docker-containers-83d65c0db110