Root-docker TBrowser how to make it accessible from host browser


Please read tips for efficient and successful posting and posting code

_ROOT Version: v6-34-02@v6-34-02
_Platform: ubuntu 24.04
_Compiler: gcc


Hello, I’m studying root using root-docker inside wsl2 windows 11, I’ve tried many tutorials, the native GUI apps does not render well in wsl2, the drop down menu are displayed in some random places, instead of under menu item (i’ve seen similar reports in the forum). I’m more interested in the new Web UI, I found the tutorials under http folder can start a server, and I can access it from the host browser.

However, it seems the TBrowser doesn’t allow similar behavior, example:

root --web=server:8080

inside root:

root [0] new TBrowser;

ROOT comes with a web-based browser, which is now being started.
Revert to TBrowser by setting "Browser.Name: TRootBrowser" in rootrc file or
by starting "root --web=off"
Find more info on https://root.cern/for_developers/root7/#rbrowser
Info in <THttpEngine::Create>: Starting HTTP server on port 127.0.0.1:8080
New web window: http://localhost:8080/win1/?key=e759e326-549dac8b-dc9ac882-9c61adb1-bb8c2784-691ae105-a3a8fe19-cfcaeb25#b9314a19-12d4eb97-6c61ca0d-7f5f71d3-7261e9e7-f799c428-c22dc535-f9cc8df9

port 8080 is published in docker, but i’m not able to access http://localhost:8080/win1/?key=e759e326-549dac8b-dc9ac882-9c61adb1-bb8c2784-691ae105-a3a8fe19-cfcaeb25#b9314a19-12d4eb97-6c61ca0d-7f5f71d3-7261e9e7-f799c428-c22dc535-f9cc8df9 from host browser

is there anyway that i can access docker TBrowser Web UI from host?
thank you!

Hello,

Thanks for the post: I am adding in the loop @linev and @bellenot .

Cheers,
D

Hi,

I am not familiar with docker, but you need to configure port forwarding from docker process to host.

Regards,
Sergey

@linev , thanks for the reply, i checked, port forwarding or publishing is done

$ docker port e311f12673a7
8080/tcp -> 0.0.0.0:8080
8080/tcp -> [::]:8080
8888/tcp -> 0.0.0.0:8888
8888/tcp -> [::]:8888

Hi,

I tried to use “standard” ROOT docker images https://hub.docker.com/r/rootproject/root

It works for me if I run docker with --net=host option. Like:

docker run --net=host --rm -it rootproject/root root --web=server:7777 

In this case all ROOT widgets accessible via provided URL.
I can start web/based TBrowser or TCanvas.

Please check how you configure port forwarding between docker and host.

Regards,
Sergey

wow, works like charm, thanks a lot!