Tips for starting any X11 apps (e.g. eclipse) in a docker container from a linux host

by Olivier Barais     docker   eclipse  

Posted 2014.08.26 — Rennes, France

Just a tips for starting any X11 apps (e.g. eclipse) in a docker container from a linux host

docker run -i -t -e DISPLAY=unix$DISPLAY -v=/tmp/.X11-unix:/tmp/.X11-unix:rw barais/eclipse-xtend /eclipse/eclipse

Do not forget to let external app to connect to X.

xhost + # for lazy reckless idiot (as me)
#For others
xhost +local:`docker inspect --format='{{ .Config.Hostname }}' $containerId`

Next you can restart your container using:

xhost +local:`docker inspect --format='{{ .Config.Hostname }}' $containerId`
docker start $containerId

To start google chrome

docker run -i -t -e DISPLAY=unix$DISPLAY -v=/tmp/.X11-unix:/tmp/.X11-unix:rw barais/browser google-chrome --disable-setuid-sandbox --user-data-dir=/tmp

To start firefox

docker run -i -t -e DISPLAY=unix$DISPLAY -v=/tmp/.X11-unix:/tmp/.X11-unix:rw barais/browser firefox

I think that I have to test that for teaching or tutorials...