How to deploy a custom slicer application on docker?

Hello, everyone, slicerjupiter and slicerdocker, which I recently learned, are really good functions. I use slicerjupiter to display the main window, which will be displayed locally, but not on the web page. Running slicerdocker, the main window will be displayed on the web page. I read the information and learned that it may be related to noVNC, How can I deploy a custom slicer application to docker and display the window on the web?

I’ve updated the slicer-notebook docker image for the latest Slicer Preview Release. I’ve tested it locally on Windows and Linux and remotely using binder. It works very well Give it a try in your web browser now by clicking [here] (Binder).

If you run Jupyter server without docker then there is no need for remote desktop access - Jupyter will start a Slicer instance locally and you can interact with it as usual. You can snap Jupyter to the left and Slicer to the right side of your screen or use two monitors to see the notebook and the Slicer GUI at the same time.

Thank you, Dr. lassoan. I still want to know what I can do to deploy a custom slicer application to docker. I know little about this and I hope you can give me a case or process. Thank you again.

I found the slicerdocker image creation file in GitHub. Can I install the slicer custom program locally during the installation step, as shown in the screenshot below? Do I have any errors in this process? Thank you very much.

Yes, instead of downloading the installer using curl, you can use an installer from a local folder or upload your extension to the web and update the download link.

You will also need SlicerJupyter extension if you want to use Slicer as a Jupyter kernel, so you need to update install.sh accordingly. Since you probably don’t want to set up an extension server, you could either get the SlicerJupyter extension package from a local folder or download it using curl.

Thanks for your help. I’ll do what you say.

Unfortunately, I made an error during the operation. I don’t know why such errors occur. I’m not very familiar with docker. Is there a problem with the dockerfile I wrote? I just added the name of the local slicer installation package, which is the Linux version installation package I downloaded from the official website, and then commented out the subsequent network downloads. Is this error because the slicer installation package has not been unzipped?



The problem is that Slicer does not seem to be installed (or at least not in the expected location). Not unzipping the downloaded package would cause this. I would recommend to start from the official, working image and just change one thing at a time and then you will know exactly where things went wrong.

Now that Slicer is fully portable, I actually find it easier not to put the Slicer download/extract and move to the dockerfile, but place it on the host and mount it with the --volume runtime option in docker. For me, it makes life easier as it removes complexity from docker build and can incorporate changes (if necessary) more easily (no longer necessary to rebuild the docker to update the slicer version or make changes)

I find docker essential when I need a fully self-contained image that will run on a remote system, such as binder.

@muratmaga if you already have the binaries extracted on the local computer then what is the advantage of running Slicer via docker instead of running it directly?

Docker still provides a consistency and a virtualization for users. Regardless of what updates happen on the host (unless it is a docker specific issue), knowing that docker image will work creates a safety buffer.

To be sure, in the lab for ourselves we use a physical system (+virtualGL). We user docker for workshops -and hopefully soon- for external people to work on their own data.

Since all docker users are the same, fixing any issue for once fixes for everyone else. (I am use a sysadmin more knowledgeable than me can essentially replicate this at the host level. I just don’t have time).

(I never used binder, every comment I made is in context of running a host for interactive session).

I see, thank you for the clarification, this makes sense.

I mostly use Windows where Slicer is very much self-contained and shared library incompatibilities are extremely rare, so it was not obvious for me how the runtime environment inside and outside docker would be different. I guess on linux things are less predictable due to the many different distros and versions.