Main Content

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:

  • 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 thedocker runcommand 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 tagr20XYzwith 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

  • -itruns the container in interactive mode.

  • --rmdeletes the container when finished.

  • -p 8888:8888exposes port 8888 for the web browser connection.

  • --shm-size=512Msets the size of the shared memory to 512 MB, which is required for MATLAB to run correctly.

  • :r20XYzchooses release version R20XYz of the MATLAB container.

  • -browserchooses 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-browseroption 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-browseroption 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-helpflag:

docker run -it --rm mathworks/matlab:r20XYz -help

For more information about configuring a MathWorks container using environment variables, seeConfigure Containers.

Related Topics

External Websites