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:”.
What I’d like is
laptop –> remote host –> docker container running eclipse
What is the best way to do that?
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):
- Connect to the
- Mount through
laptop‘s .X11 socket from the server:
user@server:$sshfs laptop:/tmp/.X11-unix /tmp/.X11-unix.
- 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 !