Skip to content

Instantly share code, notes, and snippets.

@jgwill
Last active November 9, 2020 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgwill/fdf20ccc691b0b1306ea812931893fc1 to your computer and use it in GitHub Desktop.
Save jgwill/fdf20ccc691b0b1306ea812931893fc1 to your computer and use it in GitHub Desktop.
Run GUI app on docker local or remote

How to run a GUI app from a docker image ?

Summary

  • X server install on windows (VcXsrv)
  • Sample docker file build (firefox)
  • Environment setup and launch (Powershell)

Prerequisite

VcXsrv

choco install vcxsrv

Docker image (Firefox)

FROM ubuntu:20.04
RUN apt-get update && apt-get install -y firefox
CMD /usr/bin/firefox

Build docker image

docker build -t jgwill/x__remoting_in_docker__20110922 .

Start XLaunch

  • run (WinK + r) Xlaunch
  • Next, Next until you see settings with : "Disable access control" which you click Disable access control

Setup display & Run the image (Powershell)

set-variable -name myip -value 192.168.1.76

set-variable -name DISPLAY -value $myip:0.0
docker run -ti --rm -e DISPLAY=$DISPLAY jgwill/x__remoting_in_docker__20110922

References

https://www.docker.com/blog/how-to-deploy-on-remote-docker-hosts-with-docker-compose/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment