在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mathworks-ref-arch/matlab-dockerfile开源软件地址(OpenSource Url):https://github.com/mathworks-ref-arch/matlab-dockerfile开源编程语言(OpenSource Language):Dockerfile 100.0%开源软件介绍(OpenSource Introduction):Create a MATLAB Container ImageThis repository shows you how to build and customize a Docker container for MATLAB® and its toolboxes, using the MATLAB Package Manager (mpm). You can use this container image as a scalable and reproducible method to deploy and test your MATLAB code. Requirements
Build InstructionsGet Sources# Clone this repository to your machine
git clone https://github.com/mathworks-ref-arch/matlab-dockerfile.git
# Navigate to the downloaded folder
cd matlab-dockerfile Build & Run Docker Image# Build container with a name and tag of your choice.
docker build -t matlab:r2022a .
# Run the container.
docker run --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:r2022a -batch "disp('Hello World!')" For more information on running, see the section on Run the Container. The Dockerfile defaults to building a container for MATLAB R2022a. Customize the ImageCustomize Products to Install Using MATLAB Package Manager (mpm)The Dockerfile defaults to installing MATLAB with no additional toolboxes or products into the To customize the build, edit the mpm commands in the Dockerfile's usage. You can choose products, release, and destination folder. Specify products to install as a space-separated list with the For example, to build a container with RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm && \
chmod +x mpm && \
./mpm install \
--release=${MATLAB_RELEASE} \
--destination=/tmp/matlab \
--products MATLAB Deep_Learning_Toolbox && \
rm -f mpm /tmp/mathworks_root.log && \
ln -s /tmp/matlab/bin/matlab /usr/local/bin/matlab Customize MATLAB Release and License ServerThe Dockerfile supports the following Docker build-time variables:
Use these arguments with the the Build an Image for a Different Release of MATLAB# Builds an image for MATLAB R2019b
docker build --build-arg MATLAB_RELEASE=r2019b -t matlab:r2019b . Build an Image with License Server InformationIncluding the license server information with the docker build command avoids having to pass it when running the container. # Build container with the License Server
docker build -t matlab:r2022a --build-arg LICENSE_SERVER=27000@MyServerName .
# Run the container, without needing to pass license information
docker run matlab:r2022a -batch "disp('Hello World!')" Use the Network License ManagerThis container requires a Network License Manager to license and run MATLAB. You will need either the port and hostname of the Network License Manager or a Step 1: Contact your system administrator who can provide one of:
Step 2: Use With the
With the docker run --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:r2022a -batch "disp('Hello World!')" Run the ContainerIf you did not provide the license server information while building the image, then you must provide it when running the container. Set this environment variable # Launch MATLAB, print Hello World!, and exit:
docker run --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:r2022a -batch "disp('Hello World!')" You can run the container without specifying Run MATLAB in an Interactive Command PromptTo start the container and run MATLAB in an interactive command prompt, execute: docker run -it --rm matlab:r2022a Run MATLAB in Batch ModeTo start the container, run a MATLAB command and exit, execute: # Container runs the command RAND in MATLAB and exits.
docker run --rm matlab:r2022a -batch rand Run MATLAB with Startup OptionsTo override the default behavior of the container and run MATLAB with any set of arguments, such as docker run -it --rm matlab:r2022a -logfile "logfilename.log" To learn more, see the documentation: Commonly Used Startup Options More MATLAB Docker Resources
Help Make MATLAB Even BetterYou can help improve MATLAB by providing user experience information on how you use MathWorks products. Your participation ensures that you are represented and helps us design better products. To opt out of this service, delete the following line in the Dockerfile: ENV MW_DDUX_FORCE_ENABLE=true MW_CONTEXT_TAGS=MATLAB:DOCKERFILE:V1 To learn more, see the documentation: Help Make MATLAB Even Better - Frequently Asked Questions. FeedbackWe encourage you to try this repository with your environment and provide feedback. If you encounter a technical issue or have an enhancement request, create an issue here. Copyright (c) 2021-2022 The MathWorks, Inc. All rights reserved. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论