Summary of the methods available to run gui applications inside docker
Choose the method you want to try :
ln -sf Dockerfile-<method> Dockerfile
Then build the container (firefox
is used as example in all Dockerfiles)
docker build -t dk-firefox
docker run -d \
--rm=true \
-e DISPLAY="$DISPLAY" \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
dk-firefox
docker run -ti \
--rm=true \
-e DISPLAY="$DISPLAY" \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
dk-firefox
Once the container is started, type the following commands to
- Run an
xvfb
server (X Virtual FrameBuffer) - Run
Firefox
- Run the
VNC Server
Xvfb $DISPLAY -extension GLX -screen 0 1024x780x24 &
$DISPLAY /usr/bin/firefox &
x11vnc -usepw -display $DISPLAY
TODO