MATLABContainer onDockerHub
Access MATLAB®on the cloud or in server environments by using the MATLAB container available onDockerHub. The MATLAB container provides a simple and flexible solution to run MATLAB in cloud environments such as AWS®or Microsoft®Azure®. For more information on containers, seeWhat is a Container?.
Contents
The MATLAB container includes:
An Ubuntu®base image
MATLAB (no additional toolboxes)
Dependencies to run all MathWorks®s manbetx 845
Software to enable interaction with the MATLAB desktop
Requirements
To use the MATLAB container, you need:
A host machine with Docker®installed.
A MATLAB license that is:
Valid for all the MathWorks products installed in the container.
Current onSoftware Maintenance Service(短信)。
Linked to aMathWorks Account.
Configured for cloud use. Individual and Campus-Wide licenses are already configured. For other license types, contact your license administrator. You can identify your license type and administrator by viewing yourMathWorks Account. Administrators can consultAdminister Network Licenses.
If you have a Concurrent license , you must supply the port number and DNS address of the network license manager when you run the container. Add this option to the
docker run
command when you start the container-e MLM_LICENSE_FILE=27000@MyLicenseServer
.
Quick Start Guide for MATLAB Container
本节将展示如何运行的一个例子the MATLAB container and launch an interactive MATLAB session in a web browser. For a complete list of commands to start the MATLAB container, including how to interact with MATLAB through a VNC client and how to use MATLAB in batch mode, seeMATLABContainer Image onDockerHub.
Pull Container
To download the MATLAB container image onto the host machine, run this command on the command line:
docker pull mathworks/matlab:r20XYz
You must replace the tagr20XYz
with the specific MATLAB release name, for example,r2022a
. Downloading and extracting the container image can take some time.
Run Container
Run the MATLAB container using this command:
docker run -it --rm -p 8888:8888 --shm-size=512M mathworks/matlab:r20XYz -browser
-it
runs the container in interactive mode.--rm
deletes the container when finished.-p 8888:8888
exposes port 8888 for the web browser connection.--shm-size=512M
sets the size of the shared memory to 512 MB, which is required for MATLAB to run correctly.:r20XYz
chooses release version R20XYz of the MATLAB container.-browser
chooses the option for interacting with MATLAB via a web browser.
Running the command above causes a URL to be printed to your terminal. To access MATLAB, enter the URL into a web browser. If prompted to do so, enter credentials for a MathWorks account associated with a MATLAB license.
Note
The
-browser
option is supported by docker images from release version R2022a on. To access MATLAB in a web browser in custom docker images or older MATLAB docker images, seeExamples.The
-browser
option is not supported by some browsers. For more information, seeCloud Solutions Browser Requirements.
For a full list of options and environment variables that you can use to start the container, run the container with the-help
flag:
docker run -it --rm mathworks/matlab:r20XYz -help
For more information about configuring a MathWorks container using environment variables, seeConfigure Containers.