Main Content

mosadm build-matlab-image

Build MATLAB Docker image for use in MATLAB Online Server

Since R2020a

    Description

    mosadm build-matlab-image builds a MATLAB® image from the default MATLAB install location, /MATLAB.

    mosadm build-matlab-image matlabInstallLocation builds a MATLAB image from the specified MATLAB installation location.

    example

    mosadm build-matlab-image [matlabInstallLocation] option1 ... optionN builds a MATLAB image using the specified configuration options and either of the previous syntaxes.

    Note

    mosadm build-matlab-image interacts with Docker®. If you do not have sudo administration privileges for Docker, then this command also requires sudo.

    Examples

    collapse all

    sudo ./mosadm build-matlab-image /Programs/MATLAB
    Listing images
    Checking the disk space...
    Building MATLAB image
    Determining the sizes of the folders in '/Programs/MATLAB'
    Splitting the directories and files into layers
    dockerRootDir: '/var/lib/docker' 
    ...
    Building layer 1/2, size: 2047 MB
    Saving layer 1/2
    ...
    Layer 1/2 built
    Building layer 2/2, size: 1377 MB
    Saving layer 2/2
    ...
    Layer 2/2 built
    Successfully built the image containers.mathworks.com/matlab-online-server/mos-matlab-image:1.13.0
    
    Completed build process

    Input Arguments

    collapse all

    MATLAB install location, specified as a string.

    One or more configuration options, specified as strings corresponding to valid configuration options from these tables.

    Specific to mosadm build-matlab-image

    OptionDescription
    --deployment-image-registry registryName

    Image registry to use for the deployment.

    Example: registry.yourcompany.com

    --deployment-image-repository repositoryName

    Image repository to use for the deployment images.

    Example: mathworks

    --tag tagName, -t tagName

    Image name and optional tag to use for the deployment images. Specify tagName as a string of the form name or name:tag.

    Example: mos-matlab-image

    Example: mos-matlab-image:R2024b

    --extra-reserved-file-system-space numGBs

    Extra reserved file system space for image, in GB. Specify numGBs as a numeric scalar.

    Default: 0.1

    --image-flavor imageFlavorName

    Container image flavor, specified as debian or rhel.

    Default: debian

    Common to All mosadm Commands

    OptionDescription

    --charts-dir chartsDir

    Name of the MATLAB Online Server™ charts folder to use. This folder contains the Helm® charts of the server.

    Specify chartsDir as an absolute path or a path relative to the MATLAB Online Server root folder mosRoot.

    Example: matlab_online_server/charts.

    Default: mosRoot/charts

    --data-dir dataDir

    Name of the MATLAB Online Server data folder to use.

    Specify dataDir as an absolute path or a path relative to the MATLAB Online Server root folder mosRoot.

    Example: matlab_online_server/data.

    Default: mosRoot/data

    --dry-run

    Print out the commands that would have run without this option specified but do not run the operation. Specify this option to test that the operation produces the expected results before actually executing it.

    --help, -h, help

    Output help for mosadm build-matlab-image to the command line.

    --kube-config configFilePath

    Path to the Kubernetes® cluster configuration file. Specify configFilePath as an absolute path or a path relative to the MATLAB Online Server root folder mosRoot.

    Example: /etc/kubernetes/admin.conf

    By default, configFilePath is empty and Kubernetes obtains the cluster configuration from the KUBECONFIG environment variable (if specified) or the ~/.kube/config file. If you run mosadm build-matlab-image with sudo, then ~/.kube/config is equivalent to /root/.kube/config.

    --mos-root rootDir

    MATLAB Online Server root folder, specified as an absolute path or a path relative to the current folder, that is, the folder in which you can run mosadm commands.

    Default: . (current folder)

    --overrides-dir overridesDir

    Name of the MATLAB Online Server overrides folder to use.

    Specify overridesDir as an absolute path or a path relative to the MATLAB Online Server root folder, mosRoot.

    Example: matlab_online_server/overrides

    Default: mosRoot/overrides

    --quiet, -q

    Print only the most useful or relevant output from the mosadm build-matlab-image command.

    --skip-log-file

    Skip creating the install.log file and logging data about the mosadm build-matlab-image operation to this file.

    --skip-prompt, -y

    Force acceptance of the terms of use for the mosadm build-matlab-image and skip any command-line prompts normally provided when calling this command.

    --tmp-dir tempDirName

    Name of MATLAB Online Server temporary folder to use.

    Specify tempDirName as an absolute path or a path relative to the temporary folder.

    By default, mosadm build-matlab-image generates a new temporary folder every time you run the command.

    --verbose

    Output extra details about the mosadm build-matlab-image operation to the command line.

    Tips

    • To build this image, your machine must have a TMPDIR environment variable that specifies a writable temporary directory mounted in exec mode. To mount TMPDIR in exec mode, run this command.

      mount -o remount,exec /tmp

      If you are unable to make the /tmp folder writable or you cannot mount folders in exec mode, then set a custom temporary directory by setting the --tmp-dir option.

      mosadm build-matlab-image --tmp-dir <temp-dir-name>
      <temp-dir-name> is the name of a directory that is writable and mounted in exec mode.

    • If you are using a CIS hardened image, the /tmp directory or directory specified by --tmp-dir must be have executable permissions. For more details, see CIS Hardened Images.

    • If you are using a snap install of Docker, the /tmp directory or directory specified by --tmp-dir must be under the $HOME directory. For more details, see https://snapcraft.io/install/docker/ubuntu.

    Version History

    Introduced in R2020a