In a remote SSH environment with X11 forwarding enabled, localhost:N.n
is the server-side endpoint of the forwarded X11 connection.
localhost:N.n is a TCP listener, which is why simply stripping
"localhost" from DISPLAY didn't work (removing the hostname causes Xlib
to attempt to make the connection with a Unix domain socket rather than
TCP.) By default, SSH will not allow connections to the endpoint except
through the loopback (127.0.0.1) interface, so Docker wouldn't be able
to connect to the endpoint by default. You could set "X11UseLocalhost
no" in sshd_config, thus allowing connections to the endpoint from
anywhere, but there are security ramifications to this. It sounds like
what you really need is the Unix domain socket forwarding feature in
OpenSSH 6.7 and later, although I have no idea how to set that up to
accommodate X11 forwarding.
That was just my first impression. I wouldn't be able to say for sure
without attempting to bring up their container.
> This made me wonder if it is possible to create a docker image that would
> allow a contained app to use 3D acc. from the host even for non-NVIDIA
> graphics-cards such as amd-radeon avoiding nvidia-docker.
> However, if I remove "--runtime=nvidia" from my docker run command the
> GL context seems to be gone:
> QGLTempContext: No GL capable X visuals available.
> QGLContext::makeCurrent(): Cannot make invalid context current.
> Any idea of how to realize this scenario?
> Do I need any changes in the dockerfile to make this work?
I don't think you could make this work without specific support from the
GPU vendor. My understanding is that the nvidia-docker stuff sets up an
OpenGL stack within the Docker container that allows OpenGL commands to
be passed from guest to host. Doing that in a performant way requires
hooking into the stack at the driver level, which isn't something that
can be done generically.