The Dockerfile
in this repository builds a Jupyter® Docker® image which contains the jupyter-matlab-vnc-proxy
package.
This package allows you to connect to a Linux® desktop with MATLAB® installed from your Jupyter environment.
If you want to install the MATLAB Integration for Jupyter using VNC without using Docker, use the installation instructions in the repository MATLAB Integration for Jupyter using VNC instead.
If you have access to MATLAB R2020b or later, we recommend using the alternative Use MATLAB Integration for Jupyter in a Docker Container. This alternative comes with some limitations (see Specifications and Limitations) but it enables you to open a MATLAB desktop in a web browser tab, directly from your Jupyter environment.
Before starting, make sure you have Docker installed on your system.
The Dockerfile
in this repository builds upon the base image jupyter/base-notebook
. Optionally, you can customize the Dockerfile
to build upon any alternative Jupyter Docker base image.
To build the Docker image, follow these steps:
-
Select a base container image with a MATLAB (64 bit Linux) installation. If you need to create one, follow the steps at Create a MATLAB Container Image.
-
Open the
Dockerfile
, replace the namematlab
with the name of the MATLAB image from step 1:FROM matlab AS matlab-install-stage
-
MATLAB must be on the system path in the image built in step 1. If not, then edit the following line to point to your MATLAB installation:
ARG BASE_ML_INSTALL_LOC=/tmp/matlab-install-location
For example, if MATLAB is installed at the location
/opt/matlab/R2020b
change the line above to:ARG BASE_ML_INSTALL_LOC=/opt/matlab/R2020b
-
(Optional) To preconfigure a network license manager, open the
Dockerfile
, uncomment the line below, and replaceport@hostname
with the licence server address:# ENV MLM_LICENSE_FILE port@hostname
-
Build a Docker image labelled
matlab-vnc-notebook
, using the fileDockerfile
:docker build -t matlab-vnc-notebook .
-
Start a Docker container, and forward the default Jupyter web-app port (8888) to the host machine:
docker run -it -p 8888:8888 matlab-vnc-notebook
Access the Jupyter Notebook by following one of the URLs displayed in the output of the docker run
command.
For instructions about how to use the integration, see MATLAB Integration for Jupyter using VNC.
Installing MATLAB into the Docker image can make the image very large (greater than 10GB) depending on the MATLAB toolboxes installed. To make the image smaller, you can give the Docker container access to a MATLAB installation using a volume or bind mount. For more details see Provide MATLAB as a Volume or Bind Mount.
We encourage you to try this repository with your environment and provide feedback – the technical team is monitoring this repository. If you encounter a technical issue or have an enhancement request, send an email to jupyter-support@mathworks.com
.