title: X11 forwarding of GUI app in Docker container
body: <p>I am currently trying to run some GUI apps in docker containers. I have been trying the ones by <a href="https://github.com/jessfraz" rel="noreferrer">jessie frazelle</a> at <a href="https://github.com/jessfraz/dockerfiles" rel="noreferrer">github</a>. However I can build the images (or get from docker hub) and run them without any visible errors but, the windows don't display (i cant see the app).</p>
  
  <p>I am running Docker version 1.13.1 on Ubuntu 16.04</p>
  
  <p>The image is created from:</p>
  
  <pre><code>FROM debian:stretch
  MAINTAINER Jessie Frazelle &lt;jess@linux.com&gt;
  
  RUN apt-get update &amp;&amp; apt-get install -y \
      libreoffice \
      --no-install-recommends \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  ENTRYPOINT [ "libreoffice" ]
  </code></pre>
  
  <p>the run command i am using is below:</p>
  
  <pre><code>docker run -d \
      -v /tmp/.X11-unix:/tmp/.X11-unix \
      -v /etc/localtime:/etc/localtime \
      -e DISPLAY=unix$DISPLAY 
      -v $HOME/Documents:/root/Documents \
      -e GDK_SCALE \
      -e GDK_DPI_SCALE \
      --name libreoffice \
      jess/libreoffice
  </code></pre>
  
  <p>After searching many sources, I can see that the above should work, andmost people are saying that the following lines are required in the run command,</p>
  
  <pre><code>    -v /tmp/.X11-unix:/tmp/.X11-unix
      -e DISPLAY=unix$DISPLAY
  </code></pre>
  
  <p>but still I cant get the window to display. </p>
  
  <ol>
  <li>How can I get this to work?</li>
  <li>What am I fundamentally missing?</li>
  </ol>
  
  <p>Any help would be appreciated.</p>