How to forward eclipse in a docker container through a linux proxy?

I have an Eclipse instance running on linux Ubuntu in a docker container. This container runs on a CentOS host with no physical display and I would like to forward X11 from the docker container to my laptop (running windows) through the CentOS host.
Docker container runs with

docker run  --name docker-eclipse -p 5000:5000/tcp -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix 

While I can forward X11 from the host to my laptp with no problems, I’m not able to start eclipse inside the container, because it dies with “Cannot open display:”.

  • How to edit code in a Docker container in development?
  • Docker for non-code deployments?
  • Docker - Not able to telnet Linked Container
  • Docker 1.7 consuming more space than Docker 1.5 for images
  • docker java7 install fail
  • accessing a docker container's file system through terminal
  • What I’d like is

    laptop –> remote host –> docker container running eclipse

    What is the best way to do that?

  • CircleCI: MySQL starts on its own even after stopping the process
  • How to connect to a docker box running elasticsearch inside a vagrant guest os?
  • Play Framework - Passing Application Arguments via Docker Container
  • Setting a policy for RabbitMQ as a part of Dockerfile process
  • Can we run multi-process program in docker?
  • Install OpenCV in a Docker container
  • One Solution collect form web for “How to forward eclipse in a docker container through a linux proxy?”

    This might work (server is assumed to be the remote host running Docker, laptop is assumed to be the local host from which you want the GUI):

    1. Connect to the server.
    2. Mount through sshfs the laptop‘s .X11 socket from the server: user@server:$sshfs laptop:/tmp/.X11-unix /tmp/.X11-unix.
    3. Start the container with something like user@laptop:ssh -X server docker run --name docker-eclipse -p 5000:5000/tcp -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix.

    I’m not sure this would work, and it does not feel the cleanest way of doing so, but what you want to perform is quite…. unusual (though it would be something really great !!).

    Comment your feedback !

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.