title: Alternatives to ssh X11-forwarding for Docker containers
body: <p>I am running a Docker container mainly as an isolated development environment for the <code>R</code> language. (The usage of <code>R</code> here is orthogonal to the rest of the post, i.e. you can just assume any generic program that can run in a <code>repl</code>-session.) A lot of times this will involve doing stuff like plotting, making graphics and so on; and I need to look at 
  these. Hence, I would prefer to have the option of displaying graphics I created in my container. Here is how I do this so far. First I create a <code>Dockerfile</code>. Leaving out the trivial steps the ones most relevant are:</p>
  
  <pre><code># Set root passwd 
  RUN echo "root:test" | chpasswd
  
  # Add user so that container does not run as root 
  RUN useradd -m docker 
  RUN echo "docker:test" | chpasswd 
  RUN usermod -s /bin/bash docker 
  RUN usermod -aG sudo docker 
  ENV HOME /home/docker
  
  RUN mkdir /var/run/sshd 
  RUN mkdir -p /var/log/supervisor
  
  # copy servisord.conf which lists the processes to be spawned once this 
  # container is started (currently only one: sshd) 
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  
  EXPOSE 22 
  CMD ["/usr/bin/supervisord"]
  </code></pre>
  
  <p>I build the image and then start the container by using:</p>
  
  <pre><code>docker run -d -p 127.0.0.1:5000:22 -h ubuntu-r -v /home/chb/files/Data:/home/docker/Data -P --name="rdev" ubuntu-r
  </code></pre>
  
  <p>and can then ssh into my container:</p>
  
  <pre><code>ssh -X docker@localhost -p 5000.
  </code></pre>
  
  <p>This will give me what I want. But I would like to know if there is another more resource friendly way of getting graphics/GUI output from a container? (I'd prefer, if possible, solutions would not involve <code>vnc</code>.)</p>