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:”.

  • Connection fail for Apache LDAP Authentication
  • E: Unable to locate package redis-server
  • Rancher and elasticsearch Nest
  • Run Docker in daemon mode
  • Rails assets fingerprints differ on server
  • How to specify IBM Containers' IP to register
  • What I’d like is

    laptop –> remote host –> docker container running eclipse

    What is the best way to do that?

  • How does ENTRYPOINT Docker directive react when extending images
  • How safe is to use docker in production? [closed]
  • How to execute script after container is just running
  • Virtual Machine with Vagrant is not accesible from the client the first time
  • How to get elasticsearch to work in ubuntu docker container
  • How to copy /var/lib/docker with overlayfs directory structure with data *as-is* without increasing the storage space
  • 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.