A comprehensive Docker image combining JupyterLab, PyTorch with CUDA support, 3D Slicer medical imaging platform, and VS Code in a browser-accessible environment with VNC desktop.
This project builds upon and integrates several excellent open-source projects:
- jupyter-remote-desktop-proxy: The foundation for providing VNC desktop access through Jupyter
- PyTorch Docker Images: Official PyTorch base images with CUDA support
- 3D Slicer: Open-source medical image computing platform
- code-server: VS Code in the browser by Coder
Special thanks to the JupyterHub, PyTorch, 3D Slicer, and VS Code communities for their outstanding work.
- PyTorch 2.3.1 with CUDA 12.1 and cuDNN 8 support
- JupyterLab 4.5+ with JupyterHub integration
- Python and R kernels for Jupyter notebooks
- 3D Slicer 5.10.0 medical imaging platform with dark theme
- VS Code (code-server) in the browser with Python and Jupyter extensions
- XFCE4 Desktop accessible via browser with dark theme
- Persistent authentication tokens across container restarts
- Auto-start 3D Slicer in fullscreen mode when VNC desktop opens
- Corporate proxy and certificate support
- GPU support for PyTorch and CUDA workloads
- Common development tools: vim, nano, git, tmux, htop, and more
docker build -t jupyter_rad:dev .If you're behind a corporate proxy, use these build arguments:
docker build \
--build-arg http_proxy=http://proxy.company.com:8080 \
--build-arg https_proxy=http://proxy.company.com:8080 \
--build-arg HTTP_PROXY=http://proxy.company.com:8080 \
--build-arg HTTPS_PROXY=http://proxy.company.com:8080 \
--build-arg no_proxy=localhost,127.0.0.1 \
--build-arg NO_PROXY=localhost,127.0.0.1 \
-t jupyter_rad:dev .If you need to add corporate CA certificates:
- Create a folder containing your
.crtfiles (e.g.,./corporate-certs/) - Build with the
CERTS_FOLDERargument:
docker build \
--build-arg CERTS_FOLDER=./corporate-certs \
-t jupyter_rad:dev .If you already have 3D Slicer downloaded locally and want to use it instead of downloading during build:
- Extract your Slicer archive to a folder (e.g.,
./local-slicer/Slicer-5.10.0-linux-amd64/) - Build with the
LOCAL_SLICER_FOLDERargument:
docker build \
--build-arg LOCAL_SLICER_FOLDER=./local-slicer \
-t jupyter_rad:dev .Note: The folder should contain the extracted Slicer directory (e.g., Slicer-5.10.0-linux-amd64/).
docker build \
--build-arg http_proxy=http://proxy.company.com:8080 \
--build-arg https_proxy=http://proxy.company.com:8080 \
--build-arg CERTS_FOLDER=./corporate-certs \
--build-arg LOCAL_SLICER_FOLDER=./local-slicer \
-t jupyter_rad:dev .docker run --rm -it -p 8888:8888 jupyter_rad:devdocker run --rm -it \
--gpus all \
--shm-size=2g \
-p 8888:8888 \
jupyter_rad:dev| Flag | Purpose |
|---|---|
--rm |
Automatically remove container when it stops |
-it |
Interactive terminal (see logs, enable Ctrl+C) |
--gpus all |
Enable all GPUs for CUDA workloads |
--shm-size=2g |
Increase shared memory to 2GB (prevents Slicer crashes) |
-p 8888:8888 |
Expose JupyterLab port |
Access the services in your browser:
- JupyterLab: http://localhost:8888/lab?token=YOUR_TOKEN
- VNC Desktop (3D Slicer): http://localhost:8888/desktop
- VS Code: http://localhost:8888/vscode
The authentication token is displayed when the container starts.
This image is designed to work with JupyterHub on Kubernetes. Configure it in your values.yaml file.
Once users spawn their server, they can access:
- JupyterLab: Default interface at
/user/<username>/lab - VNC Desktop (3D Slicer):
/user/<username>/desktop - VS Code:
/user/<username>/vscode
The 3D Slicer application will auto-start in the VNC desktop.
- Username:
jovyan - UID:
1000 - GID:
100(users group) - Home:
/home/jovyan - Sudo: Passwordless sudo enabled
- Auto-starts in fullscreen mode
- Dark theme pre-configured
- WebEngine disabled (prevents container crashes)
- Extensions can be installed manually
- Full write access to
/opt/Slicerdirectory
- Dark theme pre-configured
- Python extension installed
- Jupyter extension installed
- Settings persisted in
~/.local/share/code-server
- Dark Adwaita theme
- Dark background
- 3D Slicer desktop shortcut
- Edit the
Dockerfileor configuration files - Rebuild:
docker build -t jupyter_rad:dev . - Test:
docker run --rm -it --shm-size=2g -p 8888:8888 jupyter_rad:dev
Dockerfile: Main build definitionstart.sh: Container entrypoint scriptSlicerRC.py: 3D Slicer startup configurationSlicer.ini: Slicer preferencescode-server-settings.json: VS Code settingsxfce4-*.xml: Desktop environment themesjupyter_remote_desktop_proxy/share/xstartup: VNC session startup
This project maintains the original licenses of its components. See individual component documentation for details.