install simulink on docker images

21 ビュー (過去 30 日間)
Adrien
Adrien 2023 年 11 月 16 日
回答済み: Swastik Sarkar 2024 年 10 月 23 日
Hi,
I recently pull matlab images from docker Hub in my VM. I can access it on my browser and everything seems to work good. But, I don't have simulink installed so I can't open my microgrid structure. How can I install simulink ? I don't have access to add on on my page. So I would like to download the add on file of simulink but I don't manage to find it. !
Thanks !
  4 件のコメント
Adrien
Adrien 2023 年 11 月 19 日
編集済み: Adrien 2023 年 11 月 19 日
Another question, now I have simulink inside my matlab container but when I tried to import or create a project nothing happened... Do you have an idea of what is the problem ? Thanks a lot
Edit : okay seems like a licence issue :
Diagnostic Information:
Feature: MATLAB
License path:
Licensing error: 4402,0.
I use a trial version.. It is permitted ? I can't connect to the matlab interface anymore.

サインインしてコメントする。

回答 (1 件)

Swastik Sarkar
Swastik Sarkar 2024 年 10 月 23 日
To install Simulink into the mathworks/matlab Docker images using mpm, the following Dockerfile can be utilized. This Dockerfile was created based on available documentation while retaining the original base image:
ARG MATLAB_RELEASE="R2024b"
FROM mathworks/matlab:${MATLAB_RELEASE}
ARG MATLAB_RELEASE
ARG MATLAB_PRODUCT_LIST="MATLAB Simulink"
ARG MATLAB_INSTALL_LOCATION="/opt/matlab/${MATLAB_RELEASE}"
USER root
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt update \
&& apt-get install --no-install-recommends --yes \
wget \
ca-certificates \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
USER matlab
WORKDIR /home/matlab
RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \
&& chmod +x mpm \
&& sudo HOME=${HOME} ./mpm install \
--release=${MATLAB_RELEASE} \
--destination=${MATLAB_INSTALL_LOCATION} \
--products ${MATLAB_PRODUCT_LIST} \
|| (echo "MPM Installation Failure. See below for more information:" && cat /tmp/mathworks_root.log && false) \
&& sudo rm -rf mpm /tmp/mathworks_root.log \
&& sudo ln -s ${MATLAB_INSTALL_LOCATION}/bin/matlab /usr/bin/matlab
To customize the installation, adjust the MATLAB_PRODUCT_LIST to include the desired products. Build the Docker image and run it in browser mode using the following commands:
$ docker build -t matlab . # Execute in the same directory as Dockerfile
$ docker run -it --rm -p 8888:8888 --shm-size=512M matlab -browser
Upon navigating to localhost:8888, Simulink will appear in the toolstrip as depicted in the accompanying image:
Hope this helps.

カテゴリ

Help Center および File ExchangeContainers についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by