Last active
December 28, 2025 18:17
-
-
Save Dahausa/333d9366fd15c6831d17bb113b3d43ae to your computer and use it in GitHub Desktop.
Dockerfile creating a Jupyter Image with a Sysml v2 Jupyter Kernel (based on the official installation routine)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Dockerfile for a sysml v2 Jupyter environment using Jupyter Lab | |
| FROM quay.io/jupyter/base-notebook:latest AS sysmlbase | |
| WORKDIR /home/jovyan/sysmlv2 | |
| USER root | |
| #Install Java as prerequisite for the Sysml v2 Jupyter Kernel | |
| RUN apt-get update -y && apt-get install -y --no-install-recommends openjdk-21-jre wget | |
| FROM sysmlbase | |
| # Download the original installation scripts provided by Sysml v2 | |
| RUN wget https://raw.githubusercontent.com/Systems-Modeling/SysML-v2-Release/refs/heads/master/install/jupyter/install.sh | |
| RUN wget https://raw.githubusercontent.com/Systems-Modeling/SysML-v2-Release/refs/heads/master/install/jupyter/install.py | |
| # The original script uses an outdated nodejs version. Therefore the install.sh must be modified to use the appropriate nodejs version | |
| RUN sed -i 's/nodejs/nodejs=24.*/g' install.sh | |
| #Execute the installation | |
| RUN chmod +x ./install.sh | |
| RUN ./install.sh | |
| ################################# | |
| # User-Defined Sysml Libraries # | |
| ################################# | |
| # Create sysml files (*.sysml) in the directory of the Dockerfile. These files will be copied to the Kernel and available in all Sysml Notebooks | |
| ARG LIBRARY_PATH="/opt/conda/share/jupyter/kernels/sysml/sysml.library/Domain Libraries/" | |
| COPY "*.sysml" ${LIBRARY_PATH} | |
| #Change the user | |
| RUN chown -R ${NB_UID}:${NB_GID} /home/jovyan | |
| USER ${NB_UID} | |
| EXPOSE 8888 | |
| # Remove the token part to use a random token instead of 'sysml' | |
| CMD ["start-notebook.py", "--NotebookApp.token='sysml'"] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build:
docker build -t sysmlv2 .Run:
docker run -p 8888:8888 symlv2