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

  • Docker for development and production
  • docker-machine create node without tls verification
  • How do you set up selenium grid using docker on windows?
  • Can I create a container image with docker-compose build?
  • java -jar lib/kvstore.jar ping - ConnectException when using IPAddress
  • Deploying multiple Deis clusters
  • What I’d like is

    laptop –> remote host –> docker container running eclipse

    What is the best way to do that?

  • Docker MongoDB can't access from outside VM
  • Adding standard CA roots to busybox docker image
  • Traefik accessLog configuration
  • Restarting vs Building a Container on Docker
  • EF Core migrations using core, SQL Server and Docker yields dotnet SDK error
  • Meaning and usage of <alias>_PORT_<port>_<proto>_* env vars in linked containers
  • 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.