Slicer Docker for GUI via browser

I would like to use a web browser to access the Slicer GUI for a slicer instance running in a docker container.

SlicerDocker/slicer-notebook includes a Dockerfile to expose a Jupyter notebook attached to the slicer kernel, and some code related to GUI exposure: VNCPORT in Dockerfile, commented out x11vnc in run.sh. Is there an example configuration to access Slicer GUI via a web browser?

Thank you,
Nadya

Hi Nadya -

Here are some dockerfiles that set up vnc access via x11vnc and noVNC for web browser access:

-Steve

Thanks Steve, will check it out.
Nadya

I’ve got the SlicerDockers/slicer container to build (needs a different bitstream code to download Slicer 4.11.20200930 now, and curl -k to skip certificate check). The container runs fine, and shows the X environment in the browser. When I click the Slicer icon, only Slicer splash screen briefly flashes. If I open xterm and issue /opt/slicer/Slicer, I get an error:
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
I am running this docker container on Ubuntu 18, 6Gb RAM. What could be wrong here?

Sounds like you are close. You are probably running into this issue:

Thank you - it works if the following patch is applied to SlicerDockers/Dockerfile at master · pieper/SlicerDockers · GitHub

11d10
< RUN apt-get install -y --reinstall libxcb-xinerama0
12a12,13
> RUN apt-get install -y libxcb-shape0 libxcb-xinerama0 libxcb-xinerama0-dev
> RUN apt-get install -y libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0 libxcb-xkb-dev libxkbcommon-x11-dev
20,21c21,22
< RUN SLICER_URL="http://download.slicer.org/bitstream/1341035" && \
<   curl -v -s -L $SLICER_URL | tar xz -C /tmp && \
---
> RUN SLICER_URL="https://download.slicer.org/bitstream/60add70fae4540bf6a89bfb4" && \
>   curl -k -v -s -L $SLICER_URL | tar xz -C /tmp && \

That’s great Nadya. Would you be willing to put that in the form of a pull request to the repository?

Yes, sure. Please advise which way.

You can make a fork of the repository and apply your changes either directly in the github web page or in a local checkout that you push back to the fork. Then you create a pull request proposing the changes and we can discuss as needed or I’ll just go ahead and merge. I know these are small edits and I could make them myself but it’s nice for you to get credit in the history for this fix and also you can get practice for maybe bigger changes to this or other code in the future.

Thank you. This is done.

Just in case there is anyone else looking for Docker Slicer GUI, I also have one based on Ubuntu Desktop, could not rebuild Steve’s Image

Only change I made is to download and extract Slicer first, then place it in the folder with the dockerfile, and I also modify slicerrc.py to enable me copy and load files directly to the container so that it is open with the needed files.

I also create volumes for sending files in and reading files out.

Let me know if you are able to have fun with this.