webapps-containers
Setup environment to run MATLAB web apps in Docker containers on Linux systems
Since R2022b
To run MATLAB® web apps in Docker® containers, you must use MATLAB Runtime R2022b or higher. Earlier versions of MATLAB Runtime are not supported. However, you can continue to use versions of MATLAB Runtime going back to R2019b if you are not planning on running web apps in containers.
Any web apps built with MATLAB Compiler™ versions before R2022b cannot be run in a containerized environment. To address this limitation, repackage the web apps with MATLAB Compiler version R2022b or a more recent release.
Syntax
Description
webapps-containers [on | off]
sets up or tears down the Docker environment required to run MATLAB web apps in containers. You must restart the server using webapps-restart
after executing this command for changes to take effect.
Executing webapps-containers on
:
Creates a base Docker image named
mw-webapps-worker
with theTAG
nameR2024b
that consists of a Ubuntu® Linux® operating system, dependent libraries, and customizations to the base image.Creates a network for the Docker containers.
Enables running web apps in containers by setting the
use_for_workers
key to1
.Configures the firewall so that web apps can run only within the network created for containers and cannot access the internet.
Executing webapps-containers off
tears down the Docker environment created for running web apps. Values assigned to configuration
keys are preserved.
webapps-containers status
returns the setup status of the
Docker environment. It indicates whether container use is enabled
or disabled
and whether the Docker base image is present
or missing
.
webapps-containers config get
returns the entire container
configuration.
webapps-containers config get
returns
the container configuration value associated with the key keyname
keyname
.
webapps-containers config set
assigns the value keyname
val
val
to the container configuration key
keyname
. You must restart the server using webapps-restart
after executing this command for changes to take effect.
webapps-containers net
lets you modify
network settings for the container network by adjusting options
options
.
The options passed to the net
parameter are not retained when the
server is restarted. To retain options after restart, put them in the
/local/MathWorks/webapps/R2024b/config/webapps_private/containers-firewall-init.sh
file.
Examples
Input Arguments
More About
Version History
Introduced in R2022b